System V IPC vs POSIX IPC

  • What is the difference between System V IPC and POSIX IPC ?
  • Why do we have two standards?
  • How to decide which IPC features to use?
+76
posix ipc sysv
Jan 03 '11 at 8:17
source share
4 answers

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.

+97
Jan 04
source share
  1. I believe that the main difference is that all POSIX IPCs are thread-oriented, while most SysV IPCs are NOT [ 1 ].
  2. Due to the Unix Wars [ 2 ]. The UNIX Unified Specification (SUS) [ 3 ], also known as POSIX, was created to standardize interfaces on Unix-based systems.
  3. You probably want POSIX. Depends solely on your requirements.
+19
Jan 03 2018-11-11T00:
source share

System V IPC is older and POSIX IPC is newer. However, there are some differences in some aspects. Posix is ​​not always better than System V.

  • For Posix, semaphores, queues, and shared memory have Ascii string names, and System V integers.

  • System V semaphores can be automatically freed up if a process dies (semop flag SEM_UNDO). There is no such thing for Posix.

  • On Linux and FreeBSD, there is a big advantage to posix queues because the handler specified by mq_open is basically a file descriptor that can be polled by / epolled / selected / kqueued.

+5
Nov 15 '16 at 14:14
source share
  • Systen V and POSIX IPC are two different but related implementations of the same.

"Unix System V, usually abbreviated as SysV (and usually pronounced, albeit rarely spelled" System Five "), is one of the first commercial versions of the Unix operating system. It was originally developed by American Telephone & Telegraph (AT & T) and first released in 1983. "

-Wikipedia

"POSIX or" Portable Operating System Interface [for Unix] "is the name of a family of related standards defined by IEEE to define an application programming interface (API)"

-Wikipedia

  • System V has been there before. POSIX evolved from the IEEE standardization initiative.

  • GNU / Linux is partially compatible with POSIX. Which one to use depends on which OS you use this IPC with. Most vendors are moving towards POSIX .

Unix Network Programming: Interprocess Communications v. 2 Richard Stevens gives a good idea of ​​both of them.

Unix network programming

-3
Jan 03 2018-11-11T00:
source share



All Articles