[project @ 2002-04-10 11:43:49 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)
commit693872c67bade43b2a7d30f4aa7ef815199a231b
treecd0f9c4af835f96391665a9fdcb2050e555e8c3f
parent8d7f0ed5cdf85a02a1932c7ec0f5cdb01f093187
[project @ 2002-04-10 11:43:49 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/Conc.lhs