Concurrency vs Parallelism: A Practical Programming Explanation

Content edited . This editorial update does not represent a new runtime test.

On this page

Concurrency organizes multiple tasks so they can make progress during overlapping periods. Parallelism executes work at the same time. A single CPU core can interleave concurrent tasks; multiple cores can execute tasks in parallel.

A useful distinction

Question Concurrency Parallelism
What does it describe? How work is coordinated and progresses. Whether work executes simultaneously.
Does it require several CPU cores? No. CPU work needs execution resources that can run simultaneously.
Can threads be involved? Yes, but threads are not required. Yes, but creating threads alone does not prove simultaneous execution.

The concepts overlap: a concurrent program may use parallel execution, and a sequentially designed program may delegate a particular operation to a parallel implementation.

Historical illustration comparing concurrency and parallelism

The illustration was included in the original 2018 article. Its precise original attribution has not been established in this revision, so the previous confident attribution has been removed. A primary conceptual reference is Rob Pike’s Concurrency is not parallelism.

Think about waiting and work

Imagine two requests. One waits for a database result while another can parse an already available response. An event loop can make progress on the second while the first waits, even with one execution thread. That is a useful concurrency arrangement.

Now consider two independent CPU-heavy calculations running on separate cores. Their computation can happen simultaneously: that is parallel execution. Synchronization, memory access and runtime constraints can still limit speedup.

Avoid common shortcuts

“Uses multiple threads” is not a complete definition of either concept. Nor does a concurrency mechanism guarantee better performance. Identify the workload, waiting time, shared state and correctness requirements before choosing an approach.

For service-capacity terminology, see web concurrency, QPS and latency. Concurrent requests and programming concurrency are related ideas at different levels; daily page views measure neither directly.

← All articles