Concurrency Comparisons

Side-by-side trade-offs where neither column wins. The workload, the runtime and how much correctness risk you can carry decide — and each comparison ends with the verdict that follows from that, not from a preference.

Concurrency vs parallelism

The distinction the whole domain rests on. One is about structure — several things in progress at once. The other is about execution — several things running at the same instant. A system can have either, both or neither, and choosing the wrong one is how you end up with a thread pool that does not help.

DimensionConcurrencyParallelism
What it meansSeveral units of work are in progress over the same periodSeveral units of work execute at the same instant
Needs multiple coresNo — one core interleaving is enoughYes, by definition
What it buysOverlap of waiting; responsiveness; better use of one coreReduced wall-clock time for computation
Helps I/O-bound workYes — this is the whole pointOnly incidentally
Helps CPU-bound workNo — the same total CPU, interleavedYes, up to the serial fraction
Typical mechanismEvent loop, coroutines, async/await, one threadThreads on separate cores, processes, SIMD, GPU
Main failureA CPU-bound step blocks everything elseCoordination overhead exceeds the work saved
Correctness burdenInterleavings at every suspension pointInterleavings at every instruction, plus memory visibility
Use Concurrency when
  • The work is dominated by waiting: network, disk, other services.
  • You need the system to stay responsive while something slow is in progress.
  • Thousands of units of work, each cheap, each mostly idle.
Use Parallelism when
  • The work is dominated by computation and the parts are independent.
  • Wall-clock time is the objective and you have cores that are idle.
  • The work per chunk is large enough to pay for splitting and merging.
Verdict

Classify the work first. Waiting-bound work wants concurrency, and adding cores to it changes nothing. Compute-bound work wants parallelism, and adding async to it changes nothing except the number of places a bug can hide.