Concurrent Haskell
Programming language / From Wikipedia, the free encyclopedia
Concurrent Haskell extends[1] Haskell 98 with explicit concurrency. Its two main underlying concepts are:
- A primitive type
MVar α
implementing a bounded/single-place asynchronous channel, which is either empty or holds a value of typeα
. - The ability to spawn a concurrent thread via the
forkIO
primitive.
Built atop this is a collection of useful concurrency and synchronisation abstractions[2] such as unbounded channels, semaphores and sample variables.
Haskell threads have very low overhead: creation, context-switching and scheduling are all internal to the Haskell runtime. These Haskell-level threads are mapped onto a configurable number of OS-level threads, usually one per processor core.