Queues, coffee machines, and construction

2022-11-16 08:49

Another gem I stumbled upon on Joe's blog. I'll quote it right here, in case the page goes down someday:

What's the difference between concurrency and parallelism? Explain it to a five year old.

Concurrent Two queues and one coffee machine.

Parallel Two queues and two coffee machines.

Evokes an image, eh?. I like it. Sure, you aren't likely to come across two sets of queues of people trying to access one resource, but I can kind of imagine it. Maybe my closest analog is when two lanes of traffic have to converge into one due to construction, where (in an ideal state) the zipper method is being used.

Ahhhh, metaphors are nice and all, but to be honest, until I start writing more parallel code, I'm just going to be building castles in my head.