POSIX message queues
TOC
Previous
Next
POSIX Message Queues
Why (continued)
POSIX MQs provide improvements on System V MQs:
-
Queues identified by names
(/name).
("open", "unlink")
-
Reference counted
-
Kernel counts number of open references.
-
After mq_unlink(), queue
is only deleted when reference count falls to zero
(makes deletion decisions easier).
-
System V message queues are connectionless.
-
API is more consistent with Unix model.
("open", "close", "unlink"; reference counting).
-
Send/receive with timeout:
mq_timedsend(2),
mq_timedreceive(2).
-
Asynchronous notification feature
(more in moment).
-
Message queue descriptor can be monitored with
poll(2), select(2), or epoll.
Linux specific!
(C) 2006, Michael Kerrisk