r/embeddedlinux • u/maurersystems • Dec 12 '25
Real-Time Inter-Process Communication (IPC) Libraries for Embedded Linux (C & Rust)
I’ve been working on a pair of sibling libraries that provide real-time–capable inter-process communication for embedded Linux systems:
C implementation: https://github.com/mausys/rtipc
Pure Rust implementation: https://github.com/mausys/rtipc-rust
Both libraries are fully compatible with each other, so an application written using the C version can communicate seamlessly with one using the Rust version.
Status / Disclaimer
These libraries are early-stage and currently unstable.
Documentation is still sparse, but each repo includes at least one working example that shows how everything fits together. Feedback is very welcome.
Motivation
A core principle of the Unix philosophy is “do one thing and do it well.”
Microservice-like architectures follow the same idea—break functionality into small, cleanly separated processes.
In embedded systems, however, I often hear the argument that real-time constraints prohibit IPC, which often leads to tightly coupled (and sometimes messy) software architectures. My goal with this project is to show that real-time IPC is absolutely possible with the right design.
How It Works
At the heart of both libraries is a zero-copy, wait-free, single producer single consumer circular message queue. Key characteristics:
Zero-copy data transfer
Wait-free SPSC algorithm
Cacheline-aligned fixed-size messages
Nearly no runtime overhead — can even outperform mutex-protected shared data access within a single process
Uses shared memory + optional eventfds for signaling
Basic Flow
The client sets up producer/consumer queues in a shared memory region and creates optional eventfds.
It sends a unix message containing queue parameters, user data, the shared memory file descriptor, and eventfds to the server.
The server maps the shared memory and initializes its queues.
Both ends can now exchange messages in deterministic, real-time–safe fashion.
Current State
Two implementations: C and Rust
Cross-compatible (Rust ↔ C)
Suitable for embedded/RT workloads, but still evolving
Future Work
I’m developing a schema compiler in Python using Lark:
Current status: Parsing + structure verification are implemented; code generation not yet started
Goal: Generate message definitions for multiple languages—similar to protobuf, flatbuffers, cap’n proto, thrift, etc., but much simpler because only fixed-size messages need to be supported.
Higher-level languages (Java, Python, C#, etc.) will interface through the C bindings.
If anyone is interested in real-time IPC, has feedback, or wants to experiment with the examples, I’d love to hear your thoughts!
1
u/Compux72 Dec 12 '25
What’s wrong sith D-Bus and/or wayland?