Personal tools


From HaskellWiki

< Parallel(Difference between revisions)
Jump to: navigation, search
m (S-Z)

Revision as of 10:05, 20 April 2011


1 A-H

bound thread
distributed memory model
Haskell thread
A Haskell thread is a thread of execution for IO code. Multiple Haskell threads can execute IO code concurrently and they can communicate using shared mutable variables and channels.
see spark (vs threads)

2 I-M

3 N-R


4 S-Z

shared memory model
Sparks are specific to parallel Haskell. Abstractly, a spark is a pure computation which may be evaluated in parallel. Sparks are introduced with the par combinator; the expression (x `par` y) "sparks off" x, telling the runtime that it may evaluate the value of x in parallel to other work. Whether or not a spark is evaluated in parallel with other computations, or other Haskell IO threads, depends on what your hardware supports and on how your program is written. Sparks are put in a work queue and when a CPU core is idle, it can execute a spark by taking one from the work queue and evaluating it.
Sparks are ideal for speeding up pure calculations where adding non-deterministic concurrency would just make things more complicated.
OS thread
see Haskell thread, OS thread and bound thread