The System module is then used to give both a sleep function and a kind of trigger mechanism. The trigger mechanism is needed to be able to safely wake up Lwt in a multi threaded and/or multi domain program. I think it could actually be a good idea to add more multicore OCaml to Lwt to allow some way to safely interact with Lwt from any systhread on any domain.
This PR also tweaks the way the Test_scheduler does things and sets up signal handling in a way that it can work with both Picos_stdio.Unix and Lwt_unix. However, the approach done to setup signal handling is a bit of hack, IMHO. It does seem to work, but this should probably be revisited at some point. Ideally there would be some library that allows other libraries to setup signal handlers more cooperatively. The current unix/stdlib approach to setting up signal handling is non-composable and non-cooperative.
The
System
module is then used to give both asleep
function and a kind of trigger mechanism. The trigger mechanism is needed to be able to safely wake up Lwt in a multi threaded and/or multi domain program. I think it could actually be a good idea to add more multicore OCaml to Lwt to allow some way to safely interact with Lwt from any systhread on any domain.This PR also tweaks the way the
Test_scheduler
does things and sets up signal handling in a way that it can work with bothPicos_stdio.Unix
andLwt_unix
. However, the approach done to setup signal handling is a bit of hack, IMHO. It does seem to work, but this should probably be revisited at some point. Ideally there would be some library that allows other libraries to setup signal handlers more cooperatively. The current unix/stdlib approach to setting up signal handling is non-composable and non-cooperative.