Concurrency demos
Revision as of 10:14, 11 April 2009 by ChrisKuklewicz (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
This page collects examples of concurrent and parallel programming in Haskell.
Examples
- Riemann's Zeta function approximation
- Signal that you want to gracefully exit another thread
- Passing messages across a single chan to two readers
- Chat server - using a single channel for a variable number of readers
- Passing IO events lazily from a producer to a consumer thread
More examples
A large range of small demonstration programs for using concurrent and
parallel Haskell are in the Haskell concurrency regression tests. In particular, they show the use of MVars
and forkIO
.
Proposed updates
The base 3.0.3.1 package's Control.Concurrent.QSem and QSemN are not exception safe. The SafeConcurrent has the proposed replacement code.