summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsof <unknown>1999-05-13 13:08:24 +0000
committersof <unknown>1999-05-13 13:08:24 +0000
commit8997af62ca647b52a3eae314f45d86db346fab45 (patch)
tree7934f077d8becb4c2656acb379765f9597250417
parent40fc171e42f6d0bceeff32d8f737bf1be345a9a0 (diff)
downloadhaskell-8997af62ca647b52a3eae314f45d86db346fab45.tar.gz
[project @ 1999-05-13 13:08:24 by sof]
Added documentation for (yield :: IO ())
-rw-r--r--ghc/docs/libraries/Concurrent.sgml15
1 files changed, 12 insertions, 3 deletions
diff --git a/ghc/docs/libraries/Concurrent.sgml b/ghc/docs/libraries/Concurrent.sgml
index 118178c631..087baf68d6 100644
--- a/ghc/docs/libraries/Concurrent.sgml
+++ b/ghc/docs/libraries/Concurrent.sgml
@@ -3,7 +3,8 @@
<p>
This library provides the Concurrent Haskell extensions as described
-in <url name="Concurrent Haskell" url="http://research.microsoft.com/Users/simonpj/Papers/concurrent-haskell.ps.gz">.
+in <url name="Concurrent Haskell"
+ url="http://research.microsoft.com/Users/simonpj/Papers/concurrent-haskell.ps.gz">.
<tscreen><verb>
module Concurrent where
@@ -15,6 +16,7 @@ instance Ord ThreadId
forkIO :: IO () -> IO ThreadId
myThreadId :: IO ThreadId
killThread :: ThreadId -> IO ()
+yield :: IO ()
data MVar a -- Synchronisation variables
newEmptyMVar :: IO (MVar a)
@@ -71,8 +73,7 @@ Notes:
Hugs uses cooperative multitasking:
Context switches only occur when you use one of the primitives
defined in this module. This means that programs such as:
-s not been implemented yet on
-Hugs
+
<tscreen><verb>
main = forkIO (write 'a') >> write 'b'
where write c = putChar c >> write c
@@ -85,6 +86,12 @@ main = forkIO (write 'a') >> write 'b'
simple graphical user interfaces.
<item>
+The <tt>yield</tt> action forces a context-switch to any other
+currently runnable threads (if any), and is occasionally useful when
+implementing concurrency abstractions (especially so if the
+implementation of Concurrent Haskell uses cooperative multitasking).
+
+<item>
Hugs does not provide the functions <tt/mergeIO/ or <tt/nmergeIO/ since these
require preemptive multitasking.
@@ -118,4 +125,6 @@ status of the variable.
The same proviso applies to <tt/isEmptyChan/.
+These two predicates are currently only supported by GHC.
+
</itemize>