Concurrency vs Parallelism
"Concurrent" and "parallel" get used as if they meant the same thing. They don't, and the difference decides which tool you reach for. Pick wrong and you get code that is more complicated than before and no faster: threads that don't speed up a CPU-heavy job, or a process pool that does nothing for a job that mostly waits on the network.
The short version: concurrency is about structure, having several tasks in progress at once and switching between them. Parallelism is about execution, literally running several things at the same instant on different cores. This post makes that concrete with one job, processing a batch of product photos, solved first with concurrency, then with parallelism, then with both, and ends with a simple way to tell which one a problem needs.
💡 Why this matters in an interview: when you say "I'll use a thread pool here," a strong interviewer asks "why will that be faster?" The answer depends on whether the work waits (concurrency helps) or computes (parallelism helps). Saying which, and why, is what separates a guess from a design.
Two Definitions, One Kitchen
Picture a kitchen with one cook and three orders: pasta, soup and toast. The cook puts the pasta water on, and while it heats, chops vegetables for the soup, then starts the toast, then drains the pasta. Three dishes are in progress at once, and the cook switches between them whenever one is waiting (water heating, soup simmering). That is concurrency: many tasks making progress over the same period, by interleaving.
Now hire two more cooks, one per dish. All three chop and stir at the same moment. That is parallelism: many tasks running simultaneously, which needs more than one worker.
The two are independent:
- Concurrent, not parallel: one core switching between tasks. Node.js and Python's
asynciorun thousands of requests concurrently on one thread. - Parallel, not concurrent: one task split across cores that run the same operation on different data, such as a GPU shading pixels or a CPU instruction adding eight numbers at once. There aren't separate tasks to juggle, just one computation done in pieces.
- Both: a web server with a thread pool on an eight-core machine. Many requests are in progress (concurrency), and up to eight of them execute at the same instant (parallelism).
Concurrency is a way to structure a program so tasks can overlap. Parallelism is a way to execute it so they actually do. A concurrent program may or may not run in parallel, depending on the hardware and the runtime.