[Haskell-cafe] RFC: concurrent-extra

Roel van Dijk vandijk.roel at gmail.com
Tue Feb 16 10:51:42 EST 2010


Hello,

We wrote a small library (1) which offers a few extra synchronization
primitives. These primitives are found in the standard libraries of
languages like Java and Python, but not in Haskell.

Before releasing concurrent-extra on hackage, we would like some
comments on its name, design, implementation, documentation (2) and
general usefulness.

All primitives are implemented with MVars and IORefs, except for
Control.Concurrent.STM.Event.

There is a small test suite which tests some properties:

  cabal configure -ftest
  cabal build
  cabal test

The test suite still needs to be expanded a great deal. We found that
testing concurrent algorithms is really hard. Now we test things like
"this shouldn't deadlock" by checking if it doesn't take too long. But
that doesn't feel very formal. Is there a more principled approach to
testing concurrent algorithms in Haskell?

After writing our version of a read-write lock we noticed the package
rwlock (3) on hackage. But there is a difference: rwlock is
implemented with STM while our version is implemented entirely with
MVars.


Regards,
Roel & Bas van Dijk


1 - http://code.haskell.org/~roelvandijk/code/concurrent-extra/
2 - http://code.haskell.org/~roelvandijk/code/concurrent-extra/doc/html/concurrent-extra/index.html
3 - http://hackage.haskell.org/package/rwlock


More information about the Haskell-Cafe mailing list