Language-Haskell
view release on metacpan or search on metacpan
hugs98-Nov2003/libraries/Hugs/ConcBase.hs view on Meta::CPAN
-- Context switches only occur when you use one of the primitives
-- defined in this module. This means that programs such as:
--
-- main = forkIO (write 'a') >> write 'b'
-- where
-- write c = putChar c >> write c
--
-- will print either "aaaaaaaaaaaaaa..." or "bbbbbbbbbbbb..."
-- instead of some random interleaving of 'a's and 'b's.
--
-- Cooperative multitasking is sufficient for writing coroutines and simple
-- graphical user interfaces but the usual assumptions of fairness don't
-- apply and Channel.getChanContents cannot be implemented.
-----------------------------------------------------------------------------
module Hugs.ConcBase(
forkIO,
MVar,
newEmptyMVar, newMVar, takeMVar, tryTakeMVar, putMVar, tryPutMVar,
isEmptyMVar,
yield
) where
( run in 0.247 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )