Concurrency vs Parallelism

January 19, 2025 note-to-self

As always: This is for my own understanding. Please don't assume it is 100% correct.


Concurrency is handling multiple tasks during the same time.

Parallelism is actually doing tasks at the same time.

For concurrency, one person (CPU) can be doing it, for parallelism, there needs to be multiple people (CPUs) doing it.

For example, in a Kitchen an order comes in for a steak, baked potato, rolls and asparagus. One cook handling that would start the steak on the grill, put some asparagus in a pot, grab a cooked baked potato from the rack, then check on the steak, then make sure the aspargus is cooking properly, then grab two rolls and put it under the warming lights, then check the steak, etc, etc.

If there were multiple cooks, these tasks would happen, but each cook would be doing one part of it, instead of one cook flying around doing it all. So, one cook stands over the steak, making sure it's cooking well, one cook is handling the asparagus, etc.

Obviously, each of these cooks can do way more than that, and it's a waste for the restaurant to have them just standing there, so in parallelism steak-cook would be doing maybe 10 steaks at once, veggie-cook would be handling multiple kinds of veggies, etc.

If the restaurant scales from 2 tables at a slow time to 20 tables when its busier, the cooks just do more, faster. In concurrency, the cook might get overworked trying to stay with many different orders at once, and changing between which order she is working means more time making sure she doesn't make a mistake. So, parallel can do more at the same time, but concurrency is good if there is a manageable amount to be done, or slower speeds are acceptable (eg, the customers aren't going to get frustrated at up and leave).