Skip to content
BENIBIX Learn

Concurrency vs Parallelism

Concurrency and parallelism both sound like doing many things at once, but they are not the same thing. Concurrency means tasks take turns over the same span of time. One core can do it. Parallelism means tasks run at the very same instant, each on its own core. A program can be concurrent but not parallel, and the other way round.

Development⚙️ Compilers & Runtimes

Concurrency

Handling many tasks in the same stretch of time by taking turns.

Concurrency is a program dealing with many tasks over the same span of time. The tasks take turns. Each one moves on, even if only one runs at a time. While one task waits, say for a file or the network, another runs. The event loop and async code in JavaScript work this way on one thread. Running at the very same instant is a different idea, called parallelism.

Example
Lucy's Node.js server handles 1,000 visitors on one thread. While one request waits for the database, it starts on the next.
Why it matters
Most programs spend their time waiting. With concurrency they can do useful work while they wait.
Full entry
Development⚙️ Compilers & Runtimes

Parallelism

Doing many tasks at once, each on its own core.

Parallelism is running several tasks at the very same instant on different CPU cores. A big job is split into parts, and each core works on one part. A laptop with 8 cores can, at best, finish such a job about 8 times faster. In practice the gain is smaller, because the parts must be split and joined again. Parallelism needs more than one core, while concurrency does not.

Example
Emma's video app splits a 10-minute clip into 8 parts. Each of her 8 cores encodes one part at once, and the job takes 2 minutes instead of 12.
Why it matters
Single cores stopped getting much faster years ago. Using many cores at once is now the main way to speed up heavy work.
Full entry

In one line

Concurrency
Handling many tasks in the same stretch of time by taking turns.
Parallelism
Doing many tasks at once, each on its own core.