4

What I should use in my Embedded Linux environment, System V message queue or Posix message queue? What is popularly used in projects?

dexterous
  • 6,422
  • 12
  • 51
  • 99

1 Answers1

4

Both have the same basic tools -- semaphores, shared memory and message queues. They offer a slightly different interface to those tools, but the basic concepts are the same. One notable difference is that POSIX offers some notification features for message queues that Sys V does not. (See mq_notify().)

Sys V IPC has been around for longer which has a couple of practical implications.

POSIX message queues also have the following specific advantages over System V message queues:

  1. The message notification feature allows a (single) process to be asynchronously notified via a signal or the instantiation of a thread when a message arrives on a previously empty queue.

  2. On Linux (but not other UNIX implementations), POSIX message queues can be monitored using poll(), select(), and epoll(). System V message queues don’t provide this feature.

Jens
  • 69,818
  • 15
  • 125
  • 179
Ansh David
  • 654
  • 1
  • 10
  • 26
  • SysV MQ on IBM AIX had support for `select(2)` in the past. POSIX MQs are supported by `select(2)` on FreeBSD and NetBSD as of 2016 according to their `mq_open(2)` manpages. – stefanct Oct 26 '16 at 14:03