Parallel or Concurrent

2024-07-27T21:46:01+02:00

This is a story about my (hypothetical) cafe. It’s great and famous, but with a single serving window only. Obviously, I was thinking how to shorten the queue leading from the window out of the cafe to the street.

My first try was to add another serving window. But it did not help. Soon, there were two queues instead. Any single one in the queue came to the window, ordered, and waited. There were two times more waiting than before!

After removing the second serving window, I rather introduced ticketing system. I observed that somehow there is no more waiting. When people order coffee, they sit at some table and start reading newspaper, RSS feeds, make a phone call, or play Go. When their order is ready, they pick their coffe at serving window and go or finish the newspaper with a cup.

So, now I know, that if I want to reduce waiting, be more efficient, I should employ concurrency. However, if I want to scale my business and be more effective, I should go with parallelism.