Control.Concurrent documentation fix
[ghc-base.git] / Control / Concurrent.hs
index a99bc37..d9c35b8 100644 (file)
@@ -165,12 +165,16 @@ In GHC, threads may also communicate via exceptions.
 -}
 
 {- $blocking
-Calling a foreign C procedure (such as @getchar@) that blocks waiting
-for input will block /all/ threads, unless the @threadsafe@ attribute
-is used on the foreign call (and your compiler \/ operating system
-supports it).  GHC's I\/O system uses non-blocking I\/O internally to
-implement thread-friendly I\/O, so calling standard Haskell I\/O
-functions blocks only the thread making the call.
+Different Haskell implementations have different characteristics with
+regard to which operations block /all/ threads.
+
+Using GHC without the @-threaded@ option, all foreign calls will block
+all other Haskell threads in the system, although I\/O operations will
+not.  With the @-threaded@ option, only foreign calls with the @unsafe@
+attribute will block all other threads.
+
+Using Hugs, all I\/O operations and foreign calls will block all other
+Haskell threads.
 -}
 
 #ifndef __HUGS__
@@ -252,6 +256,7 @@ nmergeIO lss
 -- Bound Threads
 
 {- $boundthreads
+   #boundthreads#
 
 Support for multiple operating system threads and bound threads as described
 below is currently only available in the GHC runtime system if you use the
@@ -305,7 +310,11 @@ This means that you can use all kinds of foreign libraries from this thread
 
 Just to clarify, 'forkOS' is /only/ necessary if you need to associate
 a Haskell thread with a particular OS thread.  It is not necessary if
-you only need to make non-blocking foreign calls (see "Control.Concurrent#osthreads").
+you only need to make non-blocking foreign calls (see
+"Control.Concurrent#osthreads").  Neither is it necessary if you want
+to run threads in parallel on a multiprocessor: threads created with
+'forkIO' will be shared out amongst the running CPUs (using GHC,
+@-threaded@, and the @+RTS -N@ runtime option).
 
 -}
 forkOS :: IO () -> IO ThreadId
@@ -435,7 +444,7 @@ runInUnboundThread action = do
       worker OS threads.  If you need control over which particular OS
       thread is used to run a given Haskell thread, perhaps because
       you need to call a foreign library that uses OS-thread-local
-      state, then you need "bound threads" (see above).
+      state, then you need bound threads (see "Control.Concurrent#boundthreads").
 
       If you don't use the @-threaded@ option, then the runtime does
       not make use of multiple OS threads.  Foreign calls will block
@@ -487,7 +496,7 @@ runInUnboundThread action = do
 >          takeMVar m
 >          waitForChildren
 >    
->    forkChild :: IO () -> IO ()
+>    forkChild :: IO () -> IO ThreadId
 >    forkChild io = do
 >       mvar <- newEmptyMVar
 >       childs <- takeMVar children