What I should use in my Embedded Linux environment, System V message queue or Posix message queue? What is popularly used in projects?
1 Answers
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:
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.
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.

- 69,818
- 15
- 125
- 179

- 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