<-- Back to schedule

An Introduction to Linux IPC Facilities

Wiki Page: An Introduction to Linux IPC Facilities

Pipes, FIFOs, signals, datagram and stream sockets (and sockets in the Unix versus Internet domains), file locks (various kinds!), environment variables, memory mappings, event file descriptors (eventfd), pseudo-terminals, message queues, semaphores, shared memory, and good old regular files... The range of interprocess communication and synchronization (often referred to collectively as IPC) facilities available on Linux can at first seem bewildering. Which facilities should an application use? This tutorial provides an overview of each of the IPC facilities, showing the features that the different facilities have in common, and the features that distinguish them.

The aims of this tutorial are to provide developers with examples of the use of each of the IPC facilities and the beginnings of a roadmap to help decide which IPC facilities are likely to be most suitable when writing new applications. I'll compare different IPC facilities using measures such as portability, flexibility, ease of use, operational limits, configurability, persistence (lifetime), access control, integration with the traditional Unix "everything is a file" model and the UNIX/Linux API in general, and specific functional advantages and disadvantages. I'll also briefly consider whether one can make any general statements about relative performance of different IPC facilities.

Although aimed primarily at developers, other participants (e.g., system administrators) may find the tutorial useful for gaining greater insight into the operation, configuration, and management of the various IPC facilities.

A reading knowledge of C will be useful.

Michael Kerrisk

Michael Kerrisk (https://lca2013.linux.org.au/wiki/User:Michael_Kerrisk) is the author of the highly praised book, "The Linux Programming Interface" (http://man7.org/tlpi/), a guide and reference for system programming on Linux and UNIX. Since 2004, he has been the maintainer of the Linux man-pages project (http://man7.org/linux/man-pages/). Michael lives in Munich, Germany, and works as an editor and writer at LWN.net.