Concurrent-Haskell in GHC

Simon Marlow
Tue, 4 Feb 2003 13:00:50 -0000

> | I've started looking into the docs on GHC's
> | implementation of Concurrent-Haskell, and I got
> | confused about the architecture. Different sources
> | seem to indicate that it either:
> | - Uses one OS thread, and blocking IO calls will
> | therefore block all the Haskell-threads, or
> | - Uses one OS thread, occasionaly (50 times a second?)
> | calling select() to simulate blocking IO calls without
> | blocking other Haskell-threads, or
> | - Uses a pool of OS threads so that when a blocking IO
> | call is made, another thread takes over execution.
> Basically the last of these.  (At least in the most recent=20
> GHC.)  Simon
> Marlow implemented a web server using Concurrent Haskell, and has a
> paper about it too.

But we should really point out that you get the second method by
default; the "pool of OS threads" method is currently experimental and
not enabled unless you rebuild GHC's RTS with the right flags.

The default single-threaded IO multiplexing works pretty well, although
it doesn't scale to multiple processors of course.