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¶
- UNIX Domain Socket - local socket-based IPC
- File Descriptor Passing - transferring kernel objects through
SCM_RIGHTS - POSIX Shared Memory - direct shared data region between processes
- POSIX Message Queue - kernel-managed message-based IPC
- 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¶
- Day53 - UNIX Domain Socket and Local IPC Architecture
- Day54 - UNIX Domain Socket Advanced IPC
- Day55 - SCM_RIGHTS / File Descriptor Passing
- Day56 - POSIX Shared Memory IPC
- Day57 - POSIX Message Queue IPC
- Day58 - POSIX Semaphore Synchronization and Shared Memory Queue
Related Labs¶
- Day53 - UNIX Domain Socket IPC
- Day54 - UNIX Domain Socket Advanced IPC
- Day55 - SCM_RIGHTS File Descriptor Passing
- Day56 - POSIX Shared Memory IPC
- Day57 - POSIX Message Queue IPC
- Day58 - POSIX Semaphore IPC