[project @ 1999-03-16 13:20:07 by simonm]
authorsimonm <unknown>
Tue, 16 Mar 1999 13:20:23 +0000 (13:20 +0000)
committersimonm <unknown>
Tue, 16 Mar 1999 13:20:23 +0000 (13:20 +0000)
commit456eca7317895df8193d83b986352b6238e3824d
tree472f298aa443704a85a131de638495e29126a9e3
parent8306cc582083d331e5229cfad3c943d8b1588f89
[project @ 1999-03-16 13:20:07 by simonm]
Improvements to the threading model.

   - asynchronous exceptions supported.

- killThread# can now raise an exception in the specified
  thread.  It's new type is

killThread# :: ThreadId# -> Exception -> IO ()

  High-level versions:

killThread :: ThreadId -> IO ()
raiseInThread :: ThreadId -> Exception -> IO ()

  (killThread raises a 'ThreadKilled' exception in the
   specified thread).

  If the thread has no exception handler, it is killed
  as before.  Otherwise, the exception is passed to
  the innermost CATCH_FRAME and the thread is woken up
  if it was blocked.  The current computation is
  suspended, instead of being replaced by the exception
  (as is the case with throw).

  Sending an exception to the current thread works too.

   - new primitive: myThreadId# :: IO ThreadId# and corresponding
     high-level version myThreadId :: IO ThreadId.

   - new primitive: yield# :: IO (), and yield :: IO ().

   - the TSO now contains a pointer to the resource currently blocked
     on (MVAR or BLACKHOLE_BQ).

  - Add a giant comment to TSO.h about what the various link fields
    are supposed to do, and invariants etc.
22 files changed:
ghc/compiler/prelude/PrimOp.lhs
ghc/includes/PrimOps.h
ghc/includes/TSO.h
ghc/lib/exts/Exception.lhs
ghc/lib/std/PrelConc.lhs
ghc/lib/std/PrelGHC.hi-boot
ghc/rts/GC.c
ghc/rts/HeapStackCheck.h
ghc/rts/HeapStackCheck.hc
ghc/rts/PrimOps.hc
ghc/rts/Schedule.c
ghc/rts/Schedule.h
ghc/rts/StgMiscClosures.hc
ghc/rts/Storage.c
ghc/tests/Makefile
ghc/tests/concurrent/should_run/Makefile
ghc/tests/concurrent/should_run/conc008.hs [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc008.stdout [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc009.hs [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc009.stderr [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc010.hs [new file with mode: 0644]
ghc/tests/concurrent/should_run/conc010.stdout [new file with mode: 0644]