Level 0: Orientation & prerequisites · L0.2 OS & hardware basics for architects
Processes, threads and concurrency
Explain processes vs threads and concurrency vs parallelism.
12 min · Free
What you take away
- A process owns its memory; threads inside one process share it.
- Sharing memory makes threads cheap to talk between and dangerous to get wrong (races); isolation makes processes safe and chatty.
- Concurrency is juggling several tasks; parallelism is doing several at the same instant. Parallelism is capped by cores.
- Threads cost ~1 MB of stack and a ~1–5 µs context switch each, so tens of thousands of them is a memory and scheduling problem.
How the class is laid out
- The problem
- The simple version
- What each one buys you
- Concurrency is not parallelism
- Check your understanding