2.6 POSIX Vs System V
2.6 POSIX Vs System V
6 POSIX vs System V
2.6.1 Comparison Between System V and POSIX IPC
2.6.1.1 Introduction
System V: Introduced by AT&T in 1983, System V added three new forms of Inter-
Process Communication (IPC) mechanisms: message queues, shared memory, and
semaphores.
POSIX: Defined by the IEEE as the Portable Operating System Interface standard,
POSIX specifies application programming interfaces (APIs) for portability. It includes
support for all three IPC mechanisms introduced by System V.
System V: Covers a wide range of IPC mechanisms, including pipes, named pipes,
message queues, signals, semaphores, shared memory, sockets, and Unix domain
sockets.
POSIX: Shares the same basic concepts as System V but differs in its interface. It also
includes additional features such as thread synchronization and notification mechanisms.
System V: Does not provide built-in monitoring or notification features for message
queues.
POSIX:
Message queues can be monitored using APIs like select() , poll() , and
epoll() .
Offers notification features for message queues, such as mq_notify() .
System V: Requires system calls like shmctl() and commands like ipcs and ipcrm
to perform status and control operations.
POSIX: Shared memory objects can be examined and manipulated using system calls
like fstat() and fchmod() .
System V: The size of a shared memory segment is fixed at the time of creation using
shmget() .
POSIX: Allows resizing of shared memory objects using ftruncate() . The mapping can
then be recreated using munmap() and mmap() or the Linux-specific mremap() .
This expanded comparison highlights the key differences and similarities between System V
and POSIX IPC mechanisms, making it easier to understand their respective features and
use cases.
1. System V IPC:
System V IPC has been around since 1983 and is still widely implemented in many
systems, especially for legacy applications.
It is commonly used in older Unix-based systems and applications that rely on its
specific features, such as the SEM_UNDO flag for semaphores or the ability to deliver
messages by mtype in message queues.
Despite its age, System V IPC remains relevant in environments where backward
compatibility is critical.
2. POSIX IPC:
POSIX IPC is newer and was designed to address some of the limitations of System
V IPC. It offers a simpler, more consistent interface and better integration with the
Unix file model.
POSIX IPC is thread-safe and includes features like message queue notifications
( mq_notify() ) and the ability to monitor message queues using select() ,
poll() , or epoll() .
It is increasingly preferred for new development due to its portability and modern
design.
System V IPC is not obsolete but is considered outdated in some contexts. Here are the key
points:
1. Legacy Support:
System V IPC is still supported in most Unix-like operating systems, including Linux,
because many legacy applications depend on it.
It is unlikely to be removed entirely due to its widespread use in older systems.
2. Limitations:
System V IPC is not thread-safe, which makes it less suitable for modern multi-
threaded applications.
Its interface is considered more complex and less intuitive compared to POSIX IPC.
3. POSIX as the Future:
POSIX IPC is seen as the future standard for inter-process communication due to its
simplicity, portability, and alignment with modern programming practices.
Many vendors and developers are moving toward POSIX IPC for new projects, but
System V IPC remains in use for maintaining older systems.