Software → Programming
Concurrency
Structuring a program or system to make progress on multiple tasks during overlapping time periods.
Motivation
Concurrency solves the problem of making progress on multiple tasks whose lifetimes overlap.
Where it fits
Concurrency belongs to programming and operating systems. It connects to threads, event loops, async programming, synchronization, and race conditions.
Mental model
Concurrency is about dealing with many things at once. Parallelism is about executing many things at the exact same time.
Common mistakes
- Confusing concurrency with parallelism.
- Sharing mutable state without synchronization.
- Adding concurrency before measuring the bottleneck.