#ipc #ring-buffer #single-consumer #producer-consumer #inter-process

mspc_ipc

Multi producer single consumer ring buffer for inter-process communication

4 releases

0.1.3 Jul 28, 2024
0.1.2 Jul 26, 2024
0.1.1 Jul 25, 2024
0.1.0 Jul 25, 2024

#12 in #single-consumer

Apache-2.0

20KB
395 lines

MPSC IPC

Multi Producer Single Consumer for Inter-Process Communication

All ring-buffer implementations I was able to find assume they operate in a single process. When working across processes, the implementation must take into account that processes (producers or the consumer) can crash at any point, and the consumer must be able to recover and potentially skip broken entries.

One possibility is to use a robust futex, but that requires pthreads. In my scenario, I'm unable to use pthreads and reimplementing the logic there is too brittle.

Dependencies

~155–390KB