HeadlinesBriefing favicon HeadlinesBriefing.com

Threadprocs: Shared Address Space for Multiple Executables

Hacker News •
×

GitHub user jer-irl has released threadprocs, an experimental system that runs multiple independent programs within a single shared virtual address space. Each program operates like a separate process with its own main() function, globals, and libc instance, yet pointers remain valid across all of them for well-behaved Linux binaries. This creates a novel programming model between traditional threads and multi-process shared memory.

This approach enables zero-copy sharing of idiomatic C++ or Rust data structures like std::string directly between programs, bypassing the serialization required by typical inter-process communication (IPC). The implementation uses user-space tricks to control ASLR and perform an exec()-like operation, all without kernel modifications. It currently supports aarch64 and x86_64 Linux.

Major practical limitations prevent immediate adoption. Each threadproc has a separate libc instance, so memory allocated by one cannot be freed by another, complicating ownership of objects like std::unique_ptr. Debugging with ptrace is unsupported, and signals behave non-standardly. The author concedes the model is likely not practical for serious software but explores a provocative way to relax process memory boundaries.