liveBook · Manning

Parallelism

As explained in Grokking Simplicity

Execution in which multiple actions may occur simultaneously or without a fixed order relative to one another.

Parallelization lets multiple actions execute simultaneously or in different possible orders. Timeline diagrams separate such actions from sequential work and make their ordering visible. section 15.22

Analyze parallel work by:

  • Breaking composite operations into atomic actions, including hidden reads and writes. section 15.22
  • Drawing independent actions on separate timelines and marking required order with dotted lines. section 15.22
  • Checking whether alternative orders are impossible, desirable, or undesirable before simplifying the diagram. section 15.22

Two web requests

Waiting for cost_ajax() and shipping_ajax() sequentially adds their response times. Running them in parallel takes the longer response time, but responses can return out of order; coordination preserves correctness while retaining the speed benefit. section 17.8 section 17.13

Image

Use the timeline figure to compare parallel execution with the ordering required for correct results. section 17.13

How Grokking Simplicity covers it

How deep it goes
Explains atomic decomposition, timeline construction, timing comparisons, and coordination, while leaving language-specific constraints to the applicable execution semantics.
Examples
Uses cost_ajax() and shipping_ajax() requests, response-time comparisons, and diagrams showing sequential and parallel timelines.
What it assumes
Assumes familiarity with program actions and execution order while teaching parallel timelines and ordering constraints explicitly.
What you can do after
Diagnose ordering and timing bugs by decomposing actions, drawing timelines, and coordinating parallel work.
How it connects
Connects asynchronous callbacks, threads, processes, machines, concurrency primitives, and timeline diagrams.

Also explained in

Compare how 37 books explain parallelism →

Related concepts

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