LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 05-24-2004, 04:01 PM   #1
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
POSIX message queues...


i have always avoided message queues for some reason, as i preferred using shared memory or FIFO's for IPC. anyhow, i was bored today, and having a stevens craving so i decided to read about message queues in unpv2. so i read chapter 5 all about POSIX mq's, and then realized they were actually kinda cool and regretted always passing them by. so i go to modify an old program i wrote that used FIFO's and change it to use mq's, but... LINUX DOESN'T SUPPORT POSIX MESSAGE QUEUES!!??!! wtf is that about?? after googling for a bit i find that they are now supported in 2.6, but u also need to upgrade your glibc which sounds rather painful. i was pretty disappointed about that. it seems almost pointless to use them if you are going to be distributing an application, most people are still running 2.4, or possibly even older kernels, and almost certainly older glibc's that dont support them. pretty lame.... thoughts/experiences on/with this??
 
Old 05-24-2004, 06:05 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Linux does support "System V IPC message queue's" for quite some time. I actually used it on 2.4.x kernels, and I'm quite convinced 2.2.x also supports it. AFAIK System V syscalls are also quite portable. Do you really want the POSIX message queues?

See the man pages for "msgget", "msgctl", "msgsnd", "msgrcv" for more information.
 
Old 05-24-2004, 06:10 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
BTW, here's a (Sys V) message queue howto:

http://howtos.linux.com/guides/lpg/node27.shtml

Last edited by Hko; 05-24-2004 at 06:12 PM.
 
Old 05-24-2004, 09:21 PM   #4
skywalker27182
Member
 
Registered: Nov 2003
Posts: 35

Rep: Reputation: 15
Yes. As Hko said, Linux 2.4 and older supports System V msg qs. I have used them on my Red Hat 7.3 and 9. I think the best resource to read up on them is again Stevens, 'Unix Network Programming', (Maybe it is the first edition, the book with the green cover).
 
Old 05-24-2004, 10:09 PM   #5
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Original Poster
Rep: Reputation: 30
yep, that's the next chapter i'll have to check that out tomorrow then. but it does annoy me that linux skimps out on a number of POSIX features, especially process shared mutexes && cond variables. i grow to like freebsd more and more every day
 
Old 05-25-2004, 12:54 PM   #6
skywalker27182
Member
 
Registered: Nov 2003
Posts: 35

Rep: Reputation: 15
so is POSIX features better than System V? and checked out ur site, wayyyyy above my head, hope to reach that level someday...
 
Old 05-25-2004, 02:53 PM   #7
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Original Poster
Rep: Reputation: 30
i dont htink im qualified to really answer that question, but i can mention some of the differences. posix message queues have more features than sysV. posix ones u can be notified asynchronously, either by getting sent a signal or by a thread being spawned for each message. sysV u have to poll for messages. and for the mutex, iirc the difference is that sysV mutexes stick around in the kernel until they are explicitly deleted, u can't have anonymous ones. posix ones can be anonymous and shared in memory between processes. i guess it really isn't that big of deal, it just disappoints me when i read a whole bunch of stuff about how to use something, and i then i go to play with it and it's not supported. that's why i've been using bsd's recently b/c they are certainly a more mature OS. and thanks, i hope one day u find my site useful.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 message queues(Solaris) to SYS V message queues(Linux) devershetty Programming 1 01-22-2007 10:15 AM
message queues - please some checkup from the pros kirmet Programming 4 09-20-2005 08:40 AM
Posix Message queues? gdipierro Programming 20 07-26-2005 04:59 PM
Message Queues rag_mg Programming 1 05-08-2005 08:00 AM
Message Queues BoldKiller Programming 1 05-28-2003 05:40 PM


All times are GMT -5. The time now is 05:24 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration