Cianplan

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

  1. The problem
  2. The simple version
  3. What each one buys you
  4. Concurrency is not parallelism
  5. Check your understanding