Beginner Topic 1 of 51 Concurrency & Parallelism
Concurrency vs Parallelism
Interleaved progress versus simultaneous execution.
How it works
Concurrency is about structuring a program as multiple tasks that make progress in overlapping time periods, possibly interleaved on a single core, so it is a design concern for handling many things at once. Parallelism is about executing multiple computations literally at the same time on several cores or machines, a hardware and performance concern for doing many things faster. A program can be concurrent without being parallel, such as an event loop, and parallel without much concurrency structure, such as vectorized math.
Where it is used
Web servers handling thousands of clients use concurrency, while image processing and simulations use parallelism for speedup. Many systems combine both.
Common pitfall
Assuming concurrency automatically speeds up programs is wrong: it may add overhead without parallel hardware. Parallel programs can still have races if they share state. Choose the right tool: asynchronous I/O for waiting-bound work, threads or processes for CPU-bound work, and measure to confirm benefits.
Where it fits in the course
Concurrency vs Parallelism is topic 1 of 51 in Concurrency & Parallelism, rated Beginner. It is the first topic in this area. The next topic is Sequential Bottlenecks.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Concurrency & Parallelism quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Concurrency & Parallelism quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Concurrency vs Parallelism?
Where do people use Concurrency vs Parallelism?
What is the most common mistake with Concurrency vs Parallelism?
What should I learn before this topic?
How can I practice it?
Is Concurrency vs Parallelism hard to learn?
How long does it take to learn Concurrency vs Parallelism?
Which topics are related to Concurrency vs Parallelism?
What should I study after Concurrency vs Parallelism?
Related topics
- Sequential Bottlenecks (Concurrency & Parallelism)
- Amdahl's Law (Concurrency & Parallelism)
- Threads in Practice (Concurrency & Parallelism)
- Thread Pools (Concurrency & Parallelism)
- Concurrency Control (Databases)