I'm writing an API for some shared libraries that are written with a "binary" use in mind.
They use a ton of global state and are not thread safe.
Of course as a server, multiple users could try to use the server at the same time, these libraries can't deal with that. What's more they also like to segfault sometimes.
So what I'd like to do is have these shared libraries completely in their own address space.
What would be the best way to do that?
One thing I thought could work is have a blocking accept loop, and then fork the handling of the connection. Not sure how this would work with kj.
The other solution would be that you launch a process in the method handler that runs its own capnp server, and then proxy calls to it. Seems like it adds more overhead.