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

Fix `Picos_randos` to count alive fibers correctly #171

Closed polytypic closed 3 months ago

polytypic commented 3 months ago

The code for spawning fibers was probably copied from Picos_fifos and was also correct before enhancing Picos_randos to support running on multiple cores. With multiple runners the count must be updated before pushing new Spawns into the collection, because otherwise the count may incorrectly become 0 too early.