Skip to content
  • Simon Marlow's avatar
    [project @ 2004-10-14 14:58:37 by simonmar] · bb01a96b
    Simon Marlow authored
    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.
    bb01a96b