From 9eb6daeeacc9396f97e3aa9b3d1713ca03156709 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 16 Jan 2007 12:43:28 +0000 Subject: [PATCH] update section on "blocking" --- Control/Concurrent.hs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Control/Concurrent.hs b/Control/Concurrent.hs index adee312..1ce813c 100644 --- a/Control/Concurrent.hs +++ b/Control/Concurrent.hs @@ -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__ -- 1.7.10.4