LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2011, 05:49 AM   #1
jayadhanesh
Member
 
Registered: Feb 2009
Location: Bangalore
Posts: 61

Rep: Reputation: 15
Posix Message Queues


Hi,
I want to communicate between two threads, each belonging to a different process. Iam using message queues for this. I use mq_open()call. I created the queues with the same queue name starting with a '/'. But when I open the queue, the queue ID is different in both the process. What should I do so that both the process have the same queue ID?

Thanks,
Dhanesh.


Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.

It should stay on the 0-reply list.

Last edited by archtoad6; 01-03-2011 at 08:40 PM. Reason: move to Programming
 
Old 01-03-2011, 11:37 PM   #2
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 179Reputation: 179
Quote:
Originally Posted by jayadhanesh View Post
the queue ID is different in both the process
What is this queue ID of which you speak? The man pages (mq_overview, mq_open, mq_getattr) say nothing of a queue ID.

If what you refer to is the message queue descriptor returned to you by mq_open(), you should use that for later operations, but don't expect its value to be the same from one user of the queue to the next, even at the same time.

Does your program not work?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
POSIX Queues with message type facility of System V queues ehsan_haq98@yahoo.com Programming 2 12-27-2009 11:45 AM
Posix Message Queues culin Programming 3 04-08-2007 07:01 AM
POSIX message queues(Solaris) to SYS V message queues(Linux) devershetty Programming 1 01-22-2007 10:15 AM
Posix Message queues? gdipierro Programming 20 07-26-2005 04:59 PM
POSIX message queues... infamous41md Programming 6 05-25-2004 02:53 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration