AlgoViz
Operating Systems
Operating Systems · MediumLesson 5 of 12

Concurrency vs. parallelism

These two words get mixed up constantly, but they mean different things. CONCURRENCY is dealing with many tasks by switching between them so fast it LOOKS like they happen at once — but on one worker, only one is really running at any instant. PARALLELISM is many tasks genuinely running AT THE SAME TIME, on several workers at once. The trick to never confusing them: concurrency is about taking turns; parallelism is about actually doing things together.

One juggler vs. several jugglers

Concurrency1 core, rapid turns🧠One coreover time →ABABlooks at once — really taking turnsParallelism2 cores, both at once🧠Core 1🧠Core 2ABtruly at the same instant
Left: one core taking rapid turns between tasks A and B (concurrency). Right: two cores each running a task at the same instant (parallelism).

Imagine a single juggler keeping five balls in the air. At any frozen instant, the juggler's hands are touching only ONE ball — but they switch between all five so fast that all five stay up. From across the room it looks like they're handling five at once. They're not, really; they're taking turns incredibly quickly. That's CONCURRENCY: one worker, many tasks, rapid switching, the illusion of 'at the same time.' Now imagine five separate jugglers, each with their own ball, all tossing at the same moment. That's five balls genuinely in motion at the very same instant. That's PARALLELISM: many workers, each truly doing its task at once — no illusion, it's actually simultaneous. The difference is the number of workers. One worker can only ever fake simultaneity by switching fast (concurrency). To truly do things at the same instant, you need more than one worker (parallelism).

Why one CPU core can be concurrent but never parallel

In a computer, the 'worker' is a CPU CORE. A single core, just like the lone juggler, can work on only one task at any instant. So how does your single-core phone seem to run music, a chat, and a timer all at once? By switching between them thousands of times a second — and that switching is exactly the CONTEXT SWITCH you already met: save one task's state, load the next, over and over, super fast. Concurrency on one core IS rapid context switching. It looks simultaneous, but at any frozen moment only one task is actually running. True PARALLELISM needs MULTIPLE cores. Most computers and phones today have several (a 'multi-core' CPU). With two cores, two tasks can each have their own core and run at the very same instant — genuinely together, no taking turns. With four cores, four tasks at once, and so on. So: a single-core CPU can be concurrent (taking turns fast) but never parallel (it has only one worker). Parallelism requires more than one core. And a multi-core CPU is usually BOTH — each core takes turns among many tasks (concurrency) while the cores also run side by side (parallelism).

How this ties back to threads

Remember threads — several lines of work inside one process? Threads are how a program SPLITS itself into pieces that can be run separately. What the OS then does with those pieces depends on the hardware: • On one core, the OS runs the threads concurrently — switching between them rapidly so they all make progress, but only one is truly executing at a time. • On many cores, the OS can place different threads on different cores so they run in parallel — genuinely at the same instant. This is why 'more threads' doesn't automatically mean 'faster.' If you only have one core, ten threads still take turns on that one worker — you get concurrency, not speed. Extra threads pay off most either when you have multiple cores to truly run them in parallel, or when tasks spend time WAITING (for the network, the disk), so one thread can use the core while another waits its turn.

It's a tradeoff

Option👍 Pro👎 Con
ConcurrencyWorks on a single core — by switching turns fast, many tasks make progress and the system stays responsive even with one worker.It's only an illusion of 'at once'; at any instant just one task truly runs, and the rapid switching itself costs a little overhead.
ParallelismTasks genuinely run at the same instant, so the work actually finishes faster — real speed-up, not just responsiveness.Needs multiple cores (more hardware), and the work has to be splittable into independent pieces — not every job can be divided up.

Questions you might have

Aren't concurrency and parallelism the same thing?

No, and this is the classic mix-up. Concurrency is DEALING with many tasks by taking turns fast on one worker — it only looks simultaneous. Parallelism is actually DOING many tasks at the same instant, which needs many workers. One juggler switching between balls = concurrency; five jugglers each with a ball = parallelism.

Can a computer with only one CPU core run things in parallel?

No. One core is one worker, and one worker can only do one thing at any instant. It can be concurrent — switching between tasks so fast it looks simultaneous — but it can never be truly parallel. For real parallelism you need more than one core.

If concurrency is just taking turns, isn't it fake and useless?

Not at all — it's hugely useful. While one task waits for something slow (a download, a file to load), the core can spend that time on another task instead of sitting idle. So even on one core, concurrency keeps the computer busy and responsive. It's not fake; it's smart turn-taking.

Is concurrency on one core just rapid context switching?

Yes, exactly. To take turns between tasks, the core saves one task's state and loads the next's — a context switch — over and over, very fast. That rapid switching is what creates the illusion of many tasks running at once on a single core.

Does more cores or more threads automatically make my program faster?

Not automatically. To go faster you need both: multiple cores AND work that can be split into independent pieces to run on them in parallel. If your program is one long chain of steps that each need the previous one's result, extra cores can't help — there's nothing to run side by side.

🧠Concurrency is taking turns fast on one worker so many tasks LOOK simultaneous (one core rapidly context-switching); parallelism is many workers truly running tasks at the same instant (multiple cores). A single core can be concurrent but never parallel — real parallelism needs more than one core.
✅ Check yourself3 quick questions — prove the idea stuck.Start →🧭 Take it furtherA new system you haven't read about — would you reach for this idea, and what does it cost?Try it →

Best read after: Context switching