cvs commit: fptools/ghc/compiler/prelude primops.txt.pp fptools/ghc/includes PrimOps.h RtsAPI.h SchedAPI.h TSO.h fptools/ghc/rts Capability.c Capability.h Interpreter.c Linker.c Main.c Makefile PrimOps.hc RtsAPI.c Schedule.c Schedule.h Weak.c fptools/libraries/base ...

wolfgang at glass.cse.ogi.edu wolfgang at glass.cse.ogi.edu
Sun Sep 21 16:20:58 EDT 2003


wolfgang    2003/09/21 15:20:57 PDT

  Modified files:
    ghc/compiler/prelude primops.txt.pp 
    ghc/includes         PrimOps.h RtsAPI.h SchedAPI.h TSO.h 
    ghc/rts              Capability.c Capability.h Interpreter.c 
                         Linker.c Main.c Makefile PrimOps.hc 
                         RtsAPI.c Schedule.c Schedule.h Weak.c 
    libraries/base       Makefile 
    libraries/base/Control Concurrent.hs 
    libraries/base/include HsBase.h 
  Added files:
    libraries/base/cbits forkOS.c 
  Log:
  Bound Threads
  =============
  
  Introduce a way to use foreign libraries that rely on thread local state
  from multiple threads (mainly affects the threaded RTS).
  
  See the file threads.tex in CVS at haskell-report/ffi/threads.tex
  (not entirely finished yet) for a definition of this extension. A less formal
  description is also found in the documentation of Control.Concurrent.
  
  The changes mostly affect the THREADED_RTS (./configure --enable-threaded-rts),
  except for saving & restoring errno on a per-TSO basis, which is also necessary
  for the non-threaded RTS (a bugfix).
  
  Detailed list of changes
  ------------------------
  
  - errno is saved in the TSO object and restored when necessary:
  ghc/includes/TSO.h, ghc/rts/Interpreter.c, ghc/rts/Schedule.c
  
  - rts_mainLazyIO is no longer needed, main is no special case anymore
  ghc/includes/RtsAPI.h, ghc/rts/RtsAPI.c, ghc/rts/Main.c, ghc/rts/Weak.c
  
  - passCapability: a new function that releases the capability and "passes"
    it to a specific OS thread:
  ghc/rts/Capability.h ghc/rts/Capability.c
  
  - waitThread(), scheduleWaitThread() and schedule() get an optional
    Capability *initialCapability passed as an argument:
  ghc/includes/SchedAPI.h, ghc/rts/Schedule.c, ghc/rts/RtsAPI.c
  
  - Bound Thread scheduling (that's what this is all about):
  ghc/rts/Schedule.h, ghc/rts/Schedule.c
  
  - new Primop isCurrentThreadBound#:
  ghc/compiler/prelude/primops.txt.pp, ghc/includes/PrimOps.h, ghc/rts/PrimOps.hc,
  ghc/rts/Schedule.h, ghc/rts/Schedule.c
  
  - a simple function, rtsSupportsBoundThreads, that returns true if THREADED_RTS
    is defined:
  ghc/rts/Schedule.h, ghc/rts/Schedule.c
  
  - a new implementation of forkProcess (the old implementation stays in place
    for the non-threaded case). Partially broken; works for the standard
    fork-and-exec case, but not for much else. A proper forkProcess is
    really next to impossible to implement:
  ghc/rts/Schedule.c
  
  - Library support for bound threads:
      Control.Concurrent.
        rtsSupportsBoundThreads, isCurrentThreadBound, forkOS,
        runInBoundThread, runInUnboundThread
  libraries/base/Control/Concurrent.hs, libraries/base/Makefile,
  libraries/base/include/HsBase.h, libraries/base/cbits/forkOS.c (new file)
  
  Revision  Changes    Path
  1.29      +6 -1      fptools/ghc/compiler/prelude/primops.txt.pp
  1.104     +3 -1      fptools/ghc/includes/PrimOps.h
  1.36      +5 -8      fptools/ghc/includes/RtsAPI.h
  1.18      +5 -3      fptools/ghc/includes/SchedAPI.h
  1.32      +3 -2      fptools/ghc/includes/TSO.h
  1.18      +75 -14    fptools/ghc/rts/Capability.c
  1.11      +3 -3      fptools/ghc/rts/Capability.h
  1.45      +11 -0     fptools/ghc/rts/Interpreter.c
  1.130     +4 -1      fptools/ghc/rts/Linker.c
  1.40      +4 -2      fptools/ghc/rts/Main.c
  1.87      +8 -2      fptools/ghc/rts/Makefile
  1.113     +11 -1     fptools/ghc/rts/PrimOps.hc
  1.46      +21 -29    fptools/ghc/rts/RtsAPI.c
  1.174     +265 -106  fptools/ghc/rts/Schedule.c
  1.39      +9 -6      fptools/ghc/rts/Schedule.h
  1.30      +2 -10     fptools/ghc/rts/Weak.c
  1.49      +8 -0      fptools/libraries/base/Makefile
  1.19      +173 -1    fptools/libraries/base/Control/Concurrent.hs
  1.27      +4 -1      fptools/libraries/base/include/HsBase.h


More information about the Cvs-libraries mailing list