[Haskell-cafe] ANN: concurrent-extra-0.2

Bas van Dijk v.dijk.bas at gmail.com
Mon Feb 22 14:13:17 EST 2010


2010/2/22 Roel van Dijk <vandijk.roel at gmail.com>:
> Hello,
>
> We would like to announce an update of concurrent-extra [1].
>
> Bug fixes:
>  - A bug in RLock.acquire (thanks to Felipe Lessa).
>
> New features:
>
>  - Broadcast: Wake multiple threads by broadcasting a value. This
>   is a generalisation of Event.
>  - Thread: Threads extended with the ability to wait for their
>   termination.
>  - delay: Arbitrarily long thread delays.
>  - timeout: Wait arbitrarily long for an IO computation to finish.
>
> The lightweight thread wrapper was inspired by the threadmanager
> package [2]. The main advantage of our implementation is that we
> don't maintain an internal mapping from ThreadId to
> ThreadStatus. Instead we rely on the forked thread to broadcast
> its status to interested listeners. This should result in better
> performance (no lookup required).
>
> Every exported symbol is now documented.
>
>
> Regards,
> Roel & Bas van Dijk
>
> [1] http://hackage.haskell.org/package/concurrent-extra-0.2
> [2] http://hackage.haskell.org/package/threadmanager-0.1.3
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

We just realized we missed an important opportunity in
Control.Concurrent.Thread:

When we fork the IO computation...

http://hackage.haskell.org/packages/archive/concurrent-extra/0.2/doc/html/src/Control-Concurrent-Thread.html#fork

...we catch its potential exception and notify our listeners by
wrapping the exception into Just and broadcasting it. However when the
computation terminates normally without throwing an exception we
notify our listeners by broadcasting Nothing, ignoring its return
value (>>). This is unfortunate because we can easily broadcast the
return value by choosing an 'Either SomeException a' instead of 'Maybe
SomeException'.

We have released a new version 0.3 that changes this:

http://hackage.haskell.org/package/concurrent-extra-0.3

darcs get http://code.haskell.org/concurrent-extra

regards,

Roel and Bas van Dijk


More information about the Haskell-Cafe mailing list