close
close

IPC Mechanisms in Linux – DEV Community

In Linux, several Inter-Process Communication (IPC) mechanisms allow processes to communicate and share data. These mechanisms are critical for coordination between processes running in user space. Here are some of the most commonly used IPC mechanisms

IPC mechanism Main features Speed Usage scenarios
Blowjob Unidirectional, suitable for parent-child processes. Medium Easy communication between related processes.
Message queues Queue messages, supports priority messages. Medium Asynchronous messaging between processes.
Shared memory Fastest IPC, shared memory region accessible by multiple processes. Quick Fast data exchange between processes.
Semaphores Synchronization of processes to avoid race conditions. Medium Manage access to shared resources.
Signals Asynchronous notification. Quick Event notification, process control.
Sockets Network communication (or locally via UNIX domain). Medium/slow Network and local client-server communications.
Mmap Memory-mapped files or devices, shared memory via file allocation. Quick Shared memory via file allocations.
D bus High-level communication between applications (used in desktop environments). Medium Application level IPC (e.g. GNOME, KDE).
Eventfd/Signalfd File descriptor-based event and signal processing. Quick Processing events and signals poll or epoll.
POSIX message queues Prioritized FIFO messages, used in real-time applications. Medium Pass real-time messages.
Files Slowly but easily and continuously share data via files. Slowly Data persistence, logging, simple IPC.