Chapter 3. The concurrent package: concurrency support

Table of Contents
3.1. Concurrent Haskell
3.2. Concurrency Basics
3.3. Scheduling
3.4. Concurrency abstractions
3.5. The Concurrent library interface
3.6. GHC-specific concurrency issues

3.1. Concurrent Haskell

GHC and Hugs both provide concurrency extensions, as described in Concurrent Haskell.

Concurrency in GHC and Hugs is "lightweight", which means that both thread creation and context switching overheads are extremely low. Scheduling of Haskell threads is done internally in the Haskell runtime system, and doesn't make use of any operating system-supplied thread packages.

Haskell threads can communicate via MVars, a kind of synchronised mutable variable (see Section 3.4.3). Several common concurrency abstractions can be built from MVars, and these are provided by the Concurrent library, which is described in the later sections. Threads may also communicate via exceptions.