Are message queues obsolete in linux?

Personally I am quite fond of message queues and think they are arguably the most under-utilized IPC in the unix world. They are fast and easy to use.

A couple of thoughts:

  • Some of this is just fashion. Old things become new again. Add a shiny do-dad on message queues and they may be next year’s newest and hottest thing. Look at Google’s Chrome using separate processes instead of threads for its tabs. Suddenly people are thrilled that when one tab locks up it doesn’t bring down the entire browser.

  • Shared memory has something of a He-man halo about it. You’re not a “real” programmer if you aren’t squeezing that last cycle out of the machine and MQs are marginally less efficient. For many, if not most apps, it is utter nonsense but sometimes it is hard to break a mindset once it takes hold.

  • MQs really aren’t appropriate for applications with unbounded data. Stream oriented mechanisms like pipes or sockets are just easier to use for that.

  • The System V variants really have fallen out of favor. As a general rule go with POSIX versions of IPC when you can.

Leave a Comment