[project @ 2004-10-14 14:58:37 by simonmar]
authorsimonmar <unknown>
Thu, 14 Oct 2004 14:58:51 +0000 (14:58 +0000)
committersimonmar <unknown>
Thu, 14 Oct 2004 14:58:51 +0000 (14:58 +0000)
commitbb01a96bea6bd7808332d43a5bed78d1aff4a3fd
tree4d9eed6d623293cc97a300f0b03344194ab8f192
parent61b570fd5890bc859812faae08ad53657790566c
[project @ 2004-10-14 14:58:37 by simonmar]
Threaded RTS improvements:

 - Unix only: implement waitRead#, waitWrite# and delay# in Haskell,
   by having a single Haskell thread (the IO manager) performing a blocking
   select() operation.  Threads communicate with the IO manager
   via channels.  This is faster than doing the select() in the RTS,
   because we only restart the select() when a new request arrives,
   rather than each time around the scheduler.

   On Windows we just make blocking IO calls, we don't have a fancy IO
   manager (yet).

 - Simplify the scheduler for the threaded RTS, now that we don't have
   to wait for IO in the scheduler loop.

 - Remove detectBlackHoles(), which isn't used now (not sure how long
   this has been unused for... perhaps it was needed back when main threads
   used to be GC roots, so we had to check for blackholes manually rather
   than relying on the GC.)

Signals aren't quite right in the threaded RTS.  In fact, they're
slightly worse than before, because the thread receiving signals might
be blocked in a C call - previously there always be another thread
stuck in awaitEvent() that would notice the signal, but that's not
true now.  I can't see an easy fix yet.
ghc/rts/Capability.c
ghc/rts/Capability.h
ghc/rts/PrimOps.cmm
ghc/rts/Schedule.c
ghc/rts/Schedule.h
ghc/rts/Select.c
ghc/rts/Signals.c
ghc/rts/Signals.h