After some more coding, I’m fairly happy with what’s there now in the PR. I’d appreciate some code-review and feedback, especially on one critical function: spawnImpl
in Process.hs
. While almost everything the library does uses STM and is, hence, quite simple to reason about, spawnImpl
implements the actual spawning of new processes in threads (using async
), then monitoring the process thread for exit/failure, at which point any linked or monitoring processes must be notified.
Given asynchronous exceptions, that’s tricky. I believe things should be “fairly OK” since the library never shares Async
s/ThreadId
s outside of spawnImpl
, hence, no outside code except for the RTS can throwTo
anything to such thread (injecting an exception from one process to another happens through an STM TQueue
, handled from within the monitoring thread), but nonetheless, it’s scary
I’d be very surprised there’s no bug in there, so some extra (as well as ideas how to test this even more) would be very welcome. Link!