ANN: MSem replacement for QSem

ChrisK haskell at
Sat Apr 11 07:26:19 EDT 2009

"Grasshopper, try to take the stone from my hand"

Hello all,

  After looking at the code for QSem [1], I realize it is not exception safe.
And it does more work than needed.

  I have a proposed replacement module MSem at on the wiki.

  I claim this is a safer, more correct, and more efficient replacement for
QSem.  But I may be tragically wrong which is where you come in.  Please try and
find some strange concurrency bug that I have missed.  Once there is reviewed
replacement code I will propose changing the base package.

  Exception safe replacements for QSemN and SampleVar are also needed.

  The MSem code I have can be generalized into an "MSemN", but the semantics are
be different from "QSemN".  This MSemN only considers the needs of the first
blocked waiter instead of all of them.  The code MSemN is on the same wiki page,
perhaps someone will find this variant useful.



More information about the Libraries mailing list