Skip to content

IPC

Inter-process communication is used when separate Linux processes need to exchange data, share resources, or coordinate execution.

This section reorganizes the Day53-Day58 materials into a topic-based IPC review path.

Learning Path

  1. UNIX Domain Socket - local socket-based IPC
  2. File Descriptor Passing - transferring kernel objects through SCM_RIGHTS
  3. POSIX Shared Memory - direct shared data region between processes
  4. POSIX Message Queue - kernel-managed message-based IPC
  5. POSIX Semaphore - synchronization for process-shared data structures

IPC Design Overview

IPC Mechanism Best For Data Model Event Loop Friendly
UNIX domain socket Local client/server IPC Stream or datagram Yes
File descriptor passing Sharing kernel objects Descriptor transfer Yes, through socket fd
POSIX shared memory High-throughput shared data Shared memory region Needs extra notification
POSIX message queue Discrete command/event messages Message queue Yes on Linux
POSIX semaphore Synchronization Counter / wait-post Not directly fd-based

Key Design Rule

Shared memory solves data movement, but it does not solve synchronization.

For robust IPC design, separate these concerns:

  • data transport
  • notification
  • synchronization
  • ownership and cleanup

Notes