[Haskell-cafe] Announce: strict-concurrency

Don Stewart dons at galois.com
Mon Nov 26 18:26:44 EST 2007


While writing some multi-core concurrent code I needed more precise
control over which thread evaluated particular expressions. The default
concurrent types, MVar and Chan, are lazy, and sometimes not suitable.

The little package,

    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/strict-concurrency

Provies the MVar type, but with strict putMVar by default, and an
element-strict Chan type. 

For some applications, these stricter types can yield improved time and
space use. (For others, they can make things worse)

The strict channel type in particular seems useful, as it can be used to 
force worker threads to evaluate to WHNF before returning values to
a driver thread.

Enjoy,
    Don


More information about the Haskell-Cafe mailing list