교착 상태 (Deadlock)
프로세스가 서로를 무한정 차단하는 순환 대기.
교착 상태(데드락)는 각 프로세스가 자원을 점유한 채 다른 프로세스가 점유한 자원을 기다리기 때문에 프로세스 집합이 영구적으로 차단되는 상황입니다.
코프만(Coffman)의 4가지 조건: 상호 배제, 점유 대기, 비선점, 순환 대기가 필요합니다.
graph LR
Center["교착 상태 (Deadlock)"]:::main
Pre_process["process"]:::pre --> Center
click Pre_process "/terms/process"
Pre_mutex["mutex"]:::pre --> Center
click Pre_mutex "/terms/mutex"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 5살도 이해할 수 있게 설명
교차로에서 네 대의 차가 서로 길을 막고 있는 것을 상상해 보세요. 아무도 움직일 수 없고 영원히 갇혀 있습니다.
🤓 Expert Deep Dive
은행가 알고리즘(Banker's Algorithm)은 교착 상태를 회피합니다. 탐지는 대기 그래프(wait-for graph)를 사용합니다.
📚 출처
1. Deadlock
6. medium.com