Linux OS Internals (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
What are the Inter-Process Communication (IPC) mechanisms in Linux?
senior LevelSystem Design
In Simple Words: Ways independent processes communicate:
- Pipes & Named Pipes (FIFOs): Unidirectional byte streams between related (
|) or unrelated processes. - UNIX Domain Sockets (
AF_UNIX): Bidirectional streaming or datagram communication on the same machine. Bypasses the network stack; 2x faster than TCP loopback (localhost). - Shared Memory (
shmget/mmap): Fastest IPC! Multiple processes map the same physical RAM page into their address space. Requires synchronization via Semaphores or Mutexes. - Message Queues (
POSIX mq): Message-oriented asynchronous queues with priority support.