[project @ 2002-04-10 11:43:43 by stolz]
authorstolz <unknown>
Wed, 10 Apr 2002 11:43:49 +0000 (11:43 +0000)
committerstolz <unknown>
Wed, 10 Apr 2002 11:43:49 +0000 (11:43 +0000)
commitc1f3fad183f553aa46ec9dea33999f387014fded
treeb1087e0aa7b113fa43e05574acade0c40fd2a33d
parent3fd1d833b7d6032d67537491650c0a653bbef0e2
[project @ 2002-04-10 11:43:43 by stolz]
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.
ghc/compiler/prelude/primops.txt.pp
ghc/includes/PrimOps.h
ghc/includes/TSO.h
ghc/rts/Linker.c
ghc/rts/PrimOps.hc
ghc/rts/Schedule.c
ghc/rts/Schedule.h