It’s like deciding whether to have multiple kids building blocks at the same time or one kid building all the blocks one after another.
Concurrent is when things happen at the same time, but not necessarily all together, it's like having two friends build their own block towers while playing side by side in the sandbox. They might take turns, but they're both working on something at once.
Parallel is when things happen all together, it’s like a group of kids all building identical block towers at exactly the same time. Everyone starts and finishes together, like a team working as one.
What's the difference?
- Concurrent tasks might take turns or overlap, they're working on similar things but not always in sync.
- Parallel tasks are all going on at once, like a chorus singing together instead of taking turns.
It’s like having a race: concurrent is like two runners starting at the same time, but maybe one stops to tie their shoes; parallel is like every runner running side by side without stopping.
Examples
- Two chefs cooking different dishes in the same kitchen, each working on their own station.
- Multiple people walking through a hallway at once, not blocking each other.
Ask a question
See also
- How Does Concurrency Vs Parallelism! Work?
- Explainer: What Is an Algorithm?
- How Does Scalability vs Elasticity in 99 seconds Work?
- How Does The History of Computing Work?
- How Does The binary number system Work?