juniorConcurrency
What is a Deadlock?
Updated Apr 28, 2026
Short answer
A deadlock is a situation where two or more threads are blocked forever, each waiting for the other to release a resource.
Deep explanation
At a junior level, understanding the physical and logical boundaries of execution is key. Processes are heavy and isolated; threads are light and shared. Concurrency is a logic property (how you structure code), while parallelism is a hardware property (how code actually runs).
Real-world example
A web browser: One process for the UI, separate threads for rendering, networking, and scripts.
Common mistakes
- Thinking that multi-core processors always mean parallelism without proper software support.
Follow-up questions
- How does a CPU scheduler decide which thread runs next?