Approaches:
- Files
- Signals
- Sockets
- TCP/IP
- Unix domain sockets
- Message queues
- Pipes
- Anonymous pipes
- Named pipes
- Shared memory
- Message passing
- Memory-mapped files
- Windows: Local Inter-Process Communication (LPC/ALPC)
IPC-Bench: 🐎 Benchmarks for Inter-Process-Communication Techniques
-
Every request, every microsecond: scalable machine learning at Cloudflare
A read operation through the
Synchronizerperforms zero-copy deserialization and returns a "guarded"Resultencapsulating a reference to the Rust struct using RAII design pattern. This operation also increments the atomic counter of active readers using the struct. Once theResultis out of scope, theSynchronizerdecrements the number of readers.Linux, Windows.
-
Eclipse iceoryx: True zero-copy inter-process-communication
vcpkg
Rust: iceoryx-rs
- Eclipse iceoryx2
C/C++:
Rust:
- shmem-ipc
No messages:
-
shared_memory: A Rust wrapper around native shared memory for Linux and Windows
Applications:
-
Sensor data
很多传感器的驱动是 C++ 写的,对 C++ 的支持比较重要。
Rust:
- std::process::Stdio
- os_pipe.rs: a cross-platform library for opening OS pipes in Rust
- tokio::net
- Hyper-named-pipe: Exposes a HTTP interface over Tokio's Named Pipes implementation through a Hyper Connection interface.
Windows starts to support Unix domain sockets from Windows 17063, released on 2018-04-10. See AF_UNIX comes to Windows - Windows Command Line for details.
- ZeroMQ (GitHub)
- nanomsg (GitHub)
- NNG (GitHub)
- Zenoh: zenoh unifies data in motion, data in-use, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
-
TCP/UDP/QUIC/HTTP, shared memory
-
Communication between nodes is handled with shared memory on a same machine and TCP on distributed machines. Our shared memory implementation tracks messages across processes and discards them when obsolete. Shared memory slots are cached to avoid new memory allocation.
-
Differences between nanomsg and ZeroMQ
-
ZeroMQ
-
nanomsg
- nng-rs
- runng
- nanomsg.rs: Nanomsg library for Rust (discontinued)
-
Eclipse iceoryx2: True zero-copy inter-process-communication in pure Rust (Website, Docs.rs)
- Shared memory
- Cycle time
- Languages: Rust, C/C++
is_compatible_to()- 32-bit
Loadinggantt title Latency (in ns) - 64b payload dateFormat X axisFormat %s section iceoryx2 240 : 0, 240 section iceoryx 1000 : 0, 1000 section MQueue 700 : 0, 700 section UDS 1500 : 0, 1500Loadinggantt title Latency (in ns) - 64kb payload dateFormat X axisFormat %s section iceoryx2 240 : 0, 240 section iceoryx 1000 : 0, 1000 section MQueue 14000 : 0, 14000 section UDS 23000 : 0, 23000 -
servo/ipc-channel: A multiprocess drop-in replacement for Rust channels
-
OS
- Unix: Unix domain sockets
- Windows: named pipes
How about using shared-memory to implement ipc-channel. - Issue #128
-
-
Interprocess: Multifunctional cross-platform interprocess communication toolkit for Rust.
- Unix: Unix domain sockets, FIFO files, unnamed pipes.
- Windows: named pipes, unnamed pipes.
-
shmem-ipc: Untrusted IPC with maximum performance and minimum latency. On Rust, on Linux.
Linux: Shared memory
-
BUS/RT: Modern, fast, Rust-native IPC broker
Unix domain sockets, TCP sockets.
-
rs-ipc: A rust library for interprocess communication (discontinued)