Currently, the Miou_unix.Cond API can be a bit complex for the usage. The real issue is spurious wakeups. The "predicate" is not necessary false when a Miou_unix.Cond.wait wakeups and the user must check the predicate generally into a mutex. The basic usage is to redo the Condition.wait if we got a spurious wakeup.
On the API, we can provide something which care about that (and Miou_unix.Cond.until does that). We can also provide something more basic (with a nice documentation to explain spurious wakeups) and let the user to deal with that. Actually, Miou_unix.Cond uses a pipe() to allow the communication inter-process. We must think about what we should provide depending on implementation details.
Currently, the
Miou_unix.Cond
API can be a bit complex for the usage. The real issue is spurious wakeups. The "predicate" is not necessaryfalse
when aMiou_unix.Cond.wait
wakeups and the user must check the predicate generally into a mutex. The basic usage is to redo theCondition.wait
if we got a spurious wakeup.On the API, we can provide something which care about that (and
Miou_unix.Cond.until
does that). We can also provide something more basic (with a nice documentation to explain spurious wakeups) and let the user to deal with that. Actually,Miou_unix.Cond
uses apipe()
to allow the communication inter-process. We must think about what we should provide depending on implementation details./cc @darrenldl