What Is Parallelism? Doing Many Things Simultaneously
Parallelism is executing multiple computations at the same instant, typically by spreading work across several CPU cores or machines.
Parallelism is the act of literally doing many things at once. Where concurrency is about structuring overlapping tasks, parallelism is about running them simultaneously on real hardware: multiple cores, multiple machines, or both. It is how you make a big computation finish faster by dividing it among workers.
What parallelism requires
True parallelism needs hardware that can execute more than one instruction stream at once: multiple CPU cores, multiple machines, or a GPU. Without that, tasks can only be concurrent (interleaved), not genuinely simultaneous.
Parallelism vs concurrency
Concurrency is about structure (handling many tasks); parallelism is about execution (running them at the same time). Concurrent code can run in parallel given enough cores, but it does not have to. Parallelism is one way to execute concurrent work fast.
Kinds of parallelism
- Data parallelism: apply the same operation to many data items at once.
- Task parallelism: run different independent tasks simultaneously.
- Multi-core parallelism within one machine.
- Distributed parallelism across many machines.
The limits of going parallel
Adding workers does not scale forever. Coordination overhead, contention for shared resources, and the inherently serial part of a problem (Amdahl law) cap the speedup. Past a point, more parallelism yields diminishing returns.
A quick example
Splitting a test suite into four shards that run on four cores can finish in roughly a quarter of the time, as long as the shards are balanced and do not contend for the same resources.
Parallelism in CI
Parallelizing builds and test shards is the main lever for faster pipelines, but it needs cores. On small runners, parallel work just contends for the same few cores and barely speeds up. Larger runners (Latchkey) provide real cores so parallel jobs actually run simultaneously.
Key takeaways
- Parallelism runs multiple computations at the same instant, needing real multi-core hardware.
- It is execution, while concurrency is structure; the two are related but distinct.
- Speedups are capped by coordination overhead and the serial portion of the work.