upvote
The code uses Linux's clone3() syscall under the hood: see https://github.com/jer-irl/threadprocs/blob/main/docs/02-imp...

The interesting thing is that it's loading existing binaries and executing them in a different way than usual. I think it's pretty clever (even if unsafe, as you mentioned).

This is a splendid example of a "hack" and I wish HN had more of these!

reply
deleted
reply
> I think it can work if you want processes with different lib versions or even different languages

This is exactly right, unrelated binaries can coexist, or different versions of the same binary, etc.

> it sounds somewhat risky to pass data just like that

This is also right! I started building an application framework that could leverage this and provide some protections on memory use: https://github.com/jer-irl/tproc-actors , but the model is inherently tricky, especially with elaborate data structures where ABI compatibility can be so brittle

reply