Concurrency and Parallel Execution

Concurrency organizes tasks whose execution can overlap in time. Parallel execution requires some work actually running at the same time.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace two timelines
  2. Check the workload goal
  3. Draw timelines for overlap and simultaneous work
  4. Match performance claims to the mechanism

Trace two timelines

One core can alternate between a downloader and a reporting task as each waits. Two cores can compute different reports simultaneously. Process execution states explain the first schedule.

Check the workload goal

Overlapping waits can improve responsiveness even if CPU calculations execute on one core. A work-sharing design should identify which data tasks share. See processes and threads.[1]

Draw timelines for overlap and simultaneous work

A single core can alternate between tasks A and B, allowing both to progress over a time interval. With two cores, they may execute at the same instant if ready and permitted. A task waiting for data can overlap another task's useful compute even without simultaneous processor execution. See ready, running and blocked states.

One core: A runs 0–2, B runs 2–4, A runs 4–6
Two cores: A and B can both run 0–2
Concurrency appears in both schedules

Match performance claims to the mechanism

Overlapping waits can improve latency without doubling compute capacity. For CPU-bound work, verify actual simultaneous execution and its overhead. Capture elapsed and aggregate CPU time.

References

  1. OpenMP Architecture Review Board, OpenMP API Specifications ↩