#ipc #ring-buffer #single-consumer #producer-consumer #communication #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

Download history 176/week @ 2024-07-21 118/week @ 2024-07-28 1/week @ 2024-08-04 17/week @ 2024-09-15 9/week @ 2024-09-22 4/week @ 2024-09-29

123 downloads per month

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–395KB