cvs commit: fptools/ghc/compiler/prelude primops.txt.pp fptools/ghc/includes
PrimOps.h TSO.h fptools/ghc/rts Linker.c PrimOps.hc Schedule.c
Schedule.h fptools/libraries/base/GHC Conc.lhs
stolz@glass.cse.ogi.edu
stolz@glass.cse.ogi.edu
Wed, 10 Apr 2002 04:43:49 -0700
stolz 2002/04/10 04:43:49 PDT
Modified files:
ghc/compiler/prelude primops.txt.pp
ghc/includes PrimOps.h TSO.h
ghc/rts Linker.c PrimOps.hc Schedule.c Schedule.h
libraries/base/GHC Conc.lhs
Log:
Two new scheduler-API primops:
1) GHC.Conc.forkProcess/forkProcess# :: IO Int
This is a low-level call to fork() to replace Posix.forkProcess().
In a Concurrent Haskell setting, only the thread invoking forkProcess()
is alive in the child process. Other threads will be GC'ed!
This brings the RTS closer to pthreads, where a call to fork()
doesn't clone any pthreads, either.
The result is 0 for the child and the child's pid for the parent.
The primop will barf() when used on mingw32, sorry.
2) GHC.Conc.labelThread/forkProcess# :: String -> IO ()
Useful for scheduler debugging: If the RTS is compiled with DEBUGging
support, this primitive assigns a name to the current thread which
will be used in debugging output (+RTS -D1). For larger applications,
simply numbering threads is not sufficient.
Notice: The Haskell side of this call is always available, but if
you are not compiling with debugging support, the actual primop will
turn into a no-op.
Revision Changes Path
1.18 +13 -1 fptools/ghc/compiler/prelude/primops.txt.pp
1.93 +4 -1 fptools/ghc/includes/PrimOps.h
1.26 +4 -1 fptools/ghc/includes/TSO.h
1.87 +3 -1 fptools/ghc/rts/Linker.c
1.95 +25 -2 fptools/ghc/rts/PrimOps.hc
1.136 +80 -1 fptools/ghc/rts/Schedule.c
1.32 +2 -1 fptools/ghc/rts/Schedule.h
1.4 +13 -1 fptools/libraries/base/GHC/Conc.lhs