Welcome back to The Coder Cafe; I hope everything is OK for you. I’m still trying to figure out the best moment to send the emails; this is the reas

Concurrency is Not Parallelism - by Teiva Harsanyi

submited by
Style Pass
2024-10-21 15:00:04

Welcome back to The Coder Cafe; I hope everything is OK for you. I’m still trying to figure out the best moment to send the emails; this is the reason why emails were sent later than last week. As we have subscribers from 59 countries all over the world, it’s impossible to find a time that would be the best for everyone.

Anyway, this week, we will explore the world of concurrency. Let’s start today with this question: what are the differences between concurrency and parallelism?

It’s fairly common for developers to mix up the concepts of concurrency and parallelism, but they are actually quite distinct. Let’s approach these two concepts using a coffee shop analogy.

Imagine a coffee shop with one waiter who takes orders and makes coffee using a single machine. Customers wait in line, place their orders, and then wait for their coffee:

If the waiter struggles to keep up with the number of customers, the coffee shop owner may decide to speed up the overall process by engaging a second waiter and buying a second coffee machine. Now, two waiters can serve customers at the same time:

Leave a Comment