Both have the same basic tools - semaphores, shared memory, and message queues. They offer a slightly different interface for these tools, but the basic concepts are the same. One of the distinguishing features is that POSIX offers some notification functions for message queues that Sys V does not support. (See mq_notify() .)
Sys V IPC lasts longer, with several practical consequences -
First, POSIX IPC is used less widely. I wrote the Python shell for POSIX IPC and its documentation lists what I know about implementing POSIX IPC on different platforms .
On all the platforms listed in this documentation, Sys V IPC is fully implemented by AFAIK, while you can see that POSIX IPC is not.
A second consequence of their relative age is that POSIX IPC was developed after Sys V IPC was used for some time. Therefore, the developers of the POSIX API were able to learn about the strengths and weaknesses of the Sys V.
I should note that I have never tested performance tests to compare them. I think the old API (Sys V) would have more time to be tuned for performance, but this is just an assumption, which, of course, does not replace real testing.
As for the two standards, POSIX created its own standard because it thought it was an improvement in the Sys V. standard. But if everyone agreed that POSIX IPC is better, many many programs still use Sys V IPC, and to transfer them all POSIX IPC will take years. In practice, this would not be practical, therefore, even if all the new code had used POSIX IPC from tomorrow, Sys V IPC would stick for many years.
We cannot tell you what you should use, not knowing much more about what you intend to do, but the answers you have here should give you enough information to decide for yourself.
Philip Semanchuk Jan 04 2018-11-11T00: 00Z
source share