Safe Haskell | None |
---|---|
Language | Haskell98 |
Control.CUtils.Conc
Description
A module of concurrent higher order functions.
- data ExceptionList = ExceptionList [SomeException]
- data ConcException = ConcException
- assocFold :: forall a b. (b -> b -> IO b) -> (a -> b) -> b -> Array Int a -> IO b
- concF_ :: (?seq :: Bool) => Int -> (Int -> IO ()) -> IO ()
- conc_ :: (?seq :: Bool) -> Array Int (IO ()) -> IO ()
- concF :: (?seq :: Bool) => Int -> (Int -> IO e) -> IO (Array Int e)
- conc :: (?seq :: Bool) => Array Int (IO e) -> IO (Array Int e)
- concP :: IO t -> IO t1 -> IO (t, t1)
- oneOfF :: Int -> (Int -> IO a) -> IO a
- oneOf :: Array Int (IO a) -> IO a
Documentation
data ExceptionList Source
For exceptions caused by caller code.
Constructors
ExceptionList [SomeException] |
Instances
data ConcException Source
For internal errors. If a procedure throws this, some threads it created may still be running. It is thrown separately from ExceptionList.
Constructors
ConcException |
Instances
assocFold :: forall a b. (b -> b -> IO b) -> (a -> b) -> b -> Array Int a -> IO b Source
Runs an associative folding function on the given array. Note: this function only spawns enough threads to make effective use of the capabilities. Any two list elements may be processed sequentially or concurrently. To get parallelism, you have to set the numCapabilities value, e.g. using GHC's +RTS -N flag.
concF :: (?seq :: Bool) => Int -> (Int -> IO e) -> IO (Array Int e) Source
The next two functions take an implicit parameter ?seq. Set it to True if you want to only spawn threads for the capabilities (same as assocFold, good for speed). If you need all the actions to be executed concurrently, set it to False.
n is the number of computations which are indexed from 0 to n - 1.