theolaurent / ocaml-reagent

An implementation of reagents for multicore OCaml
ISC License
4 stars 0 forks source link

Idle domain counter does not work properly #10

Closed theolaurent closed 9 years ago

theolaurent commented 9 years ago

I occasionally get a segfault with the swap.ml file and my last version of the scheduler (with the idle domain counter).

kayceesrk commented 9 years ago

I can't seem to replicate the segault. Can you try with ocaml-multicore with the latest updates [1]? I had some fixes for the stack promotion. Also, the idle domain counter does not deterministically work as expected. Sometimes the scheduler terminates early:

$ ./swap.byte 
=== Start scheduling ===
=    Spawn domain 1    =
[0:16= Domain ] starting main
1**** Test 1 ****
 is now idle =
= Domain 1 just waked  =
= Domain 0 is now idle =
= Domain 1 is now idle =  

[1] https://github.com/kayceesrk/ocaml-multicore master branch

theolaurent commented 9 years ago

Ok, with your master branch I don't have the segfault.

theolaurent commented 9 years ago

I changed the way the idle counter is in/decremented. It should work fine now.