deadlock(교착 상태)은 둘 이상의 thread가 각각 영원히 block된 채, 각자가 다른 쪽이 보유한 자원을 기다리는 상태다. 아무것도 진행되지 않는다.
네 가지 필요(Coffman) 조건
네 가지가 동시에 성립해야 한다 — 어느 하나라도 없애면 deadlock은 불가능하다:
text
1. Mutual exclusion → a resource is held exclusively (only one holder at a time)
2. Hold and wait → a thread holds one resource while waiting to acquire another
3. No preemption → resources can't be forcibly taken; only released voluntarily
4. Circular wait → a cycle: T1 waits for R2 (held by T2), T2 waits for R1 (held by T1)
