cpp-ipc (libipc) is a C++17 library for high-performance IPC over shared memory on Linux, Windows, and FreeBSD with lock-free or lightweight locking.
Overview
cpp-ipc provides inter-process communication for C++ programs using shared memory. It targets Linux, Windows, and FreeBSD on common CPU architectures and depends only on the standard library besides optional platform APIs for waiting.
Communication uses circular array structures underneath. The ipc::route type supports one writer with multiple readers, while ipc::channel supports multiple writers and readers on the same channel, with a documented cap on concurrent receivers per channel. Broadcasting is the default delivery mode, and callers can choose other read and write combinations.
Synchronization relies on lock-free algorithms or light spin locks rather than heavy mutexes. Senders retry briefly before falling back to semaphores so peers do not busy-wait indefinitely, and timeouts are supported. Usage patterns and API details are documented in the project wiki, with unit and benchmark tests published alongside sample performance measurements.
Key features
- Shared-memory IPC channels
- Single-writer multi-reader routes
- Multi-writer multi-reader channels
- Lock-free or spin-lock sync
- Semaphore-backed waiting
- Configurable broadcast delivery
- C++17 with STL only
- Linux, Windows, FreeBSD support
Use cases
- Low-latency cross-process messaging
- Multiprocess service architectures
- Embedded desktop components
- Benchmarked IPC pipelines
- Single-producer fan-out data