Next Generation, sub-microsecond latency shared memory IPC.
This is a shared-memory based pub/sub Interprocess Communication system that can be used in robotics and other applications. Why subspace? If your messages are transported between processes on the same computer, they travel through extremely low latency and high bandwidth shared memory buffers, kind of like they are going faster than light (not really, of course). If they go between computers, they are transported over the network at sub-light speed.
It has the following features:
See the file docs/subspace.pdf for full documentation.
This uses Google's Bazel to build. You will need to download Bazel to build it. The build also needs some external libraries, but Bazel takes care of downloading them. The .bazelrc file contains some configuration options.
bazel build --config=apple_silicon ...
Subspace really wants to be built using clang. Depending on how your OS is configured, you might need to tell bazel what compiler to use.
CC=clang bazel build ...
It does build with g++ but you will get some compiler warnings about different signed comparisons that clang doesn't care about.
Build a minimal set of binaries:
CC=clang bazel build //server:subspace_server //manual_tests:{pub,sub}
Then run each in a separate terminal:
./bazel-bin/server/subspace_server
./bazel-bin/manual_tests/sub
./bazel-bin/manual_tests/pub
Add this to your Bazel WORKSPACE file to get access to this library without downloading it manually.
http_archive(
name = "subspace",
urls = ["https://github.com/dallison/subspace/archive/refs/tags/A.B.C.tar.gz"],
strip_prefix = "subspace-A.B.C",
)
You can also add a sha256 field to ensure a canonical build if you like. Bazel will tell you what to put in for the hash when you first build it.