Deadlock: The Infinite Waiting Game (Definitive Guide)
교착 상태(Deadlock): 멈춰버린 컴퓨터와 철학자들의 침묵 (완전정복)
Why processes freeze forever. From Dining Philosophers to Distributed Deadlock Detection. Includes Resource Allocation Graphs, Banker's Algorithm, and Java/DB examples.
c
codemapo
INTERDISCIPLINARY DEV · SEOUL
9. FAQ
Q: Is Deadlock a bug?
A: Yes, it's a logical concurrency bug. It means the system design allows for Circular Wait.
Q: Does Java GC handle deadlocks?
A: No. Garbage Collector manages memory, not thread locks. You need to verify standard tools like jstack.
Q: Can you have a deadlock with 1 process?
A: Yes, if a single process tries to acquire a non-reentrant lock it already holds. (Self-deadlock).
Q: How does Ctrl+Alt+Del (Task Manager) work if the OS is deadlocked?
A: It usually triggers a high-priority interrupt that bypasses normal scheduling queues, allowing you to kill the frozen process.
Q: What is a Spinlock?
A: A lock that causes a thread to wait in a loop utilizing CPU ("busy waiting") rather than sleeping. Efficient for short waits but wasteful for long ones.
Q: How does MySQL InnoDB detect deadlocks?
A: It maintains a Wait-For Graph in memory. When a cycle is detected, it rolls back the transaction that has done the least work (smallest undo log).