Chapter 2. The concurrent category: concurrency support

Table of Contents
2.1. Concurrent Haskell
2.2. Concurrency Basics
2.3. Scheduling
2.4. Concurrency abstractions
2.5. The Concurrent library interface
2.6. GHC-specific concurrency issues

2.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 2.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.