About Haskell Thread Model

William Lee Irwin III wli at holomorphy.com
Mon Oct 13 02:02:04 EDT 2003

On Sat, Oct 11, 2003 at 10:58:04PM +0200, Wolfgang Thaller wrote:
> If you compile the bleeding-edge GHC from the CVS HEAD, you'll get 
> something else; while "most" threads (those created using "forkIO") are 
> still light-weight threads that are scheduled in just one kernel 
> thread, you can also create threads that get their own operating system 
> thread. This is solves all the problems that lightweight threads can 
> have with foreign (i.e. non-Haskell) libraries.
> You should also note that no Haskell implementation currently supports 
> SMP; even when multiple kernel threads are used, there is a mutual 
> exclusion lock on the Haskell heap, so a multithreaded Haskell program 
> will use only one CPU on an SMP system.
> I hope my answer was useful...

That's a painful-sounding state of affairs, though not entirely
unexpected. It would be interesting to hear of "BKL breakup" efforts
for Haskell runtime systems, though anymore I'm totally ignorant of
what the devil is going on in userspace except database-only syscalls.

-- wli

More information about the Haskell mailing list