ocaml-multicore / picos

Interoperable effects based concurrency
https://ocaml-multicore.github.io/picos/doc/picos/index.html
ISC License
86 stars 3 forks source link

Try even harder to use all threads when there are ready fibers #258

Closed polytypic closed 1 month ago

polytypic commented 1 month ago

This tweaks the protocol for waking up worker threads in the multififo and random schedulers to make it less likely that a thread would go unused when there are ready fibers. I don't have the mental energy at this moment to go through the logic carefully enough to satisfy myself on whether the changes are sufficient to provide an absolute guarantee that no thread goes unused. I'm testing this in Kcas PR that changes Kcas to use Picos and it now seems to work. 🤞