liveBook · Manning

Haskell execution context

As explained in Learn Haskell by Example

A Haskell execution context is a runtime execution context that evaluates sparks, typically on an operating-system thread.

A Haskell execution context (HEC) is a runtime-managed execution context, typically living on its own operating-system thread, that evaluates sparks in parallel. section 13.4.3

HECs take sparks from a shared spark pool using work stealing. The runtime also handles sparks that are evaluated early, discarded by garbage collection, or become invalid. section 13.4.3

Starting parallel evaluation

The Eval monad and runEval expose parallel evaluation; rpar places x in the spark pool without waiting for its result. section 13.4.3

How Learn Haskell by Example covers it

How deep it goes
Explains threads, spark pools, work stealing, and runtime edge cases, while deferring their messy implementation details.
Examples
Uses rpar with runEval to demonstrate placing a computation into the spark pool.
What it assumes
Assumes familiarity with sparks and thunks while introducing HEC scheduling through a practical parallel-evaluation example.
What you can do after
Apply the Eval monad, runEval, and rpar to initiate parallel evaluation.
How it connects
Connects HECs with sparks, spark pools, work stealing, rpar, the Eval monad, and runEval.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Haskell by Example. The section links point to the parts of the book it draws on.