Deadlock Detection
Deadlock Detection
- 系統必須提供一個演算法去檢視是否有deadlock發生
- 需要一個演算法來回復deadlock
single instance
- 當有cycle的時候會發生deadlock
- an edge from Pi to Pj 代表 Pi 在等 Pj 釋放一個 Pi 需要的資源
- 圖(b)叫做 wait-for graph
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
several instance
- data structure
- Available
- Allocation
- Request
- matrix
Request[i, j] = k
代表Pi 正請求k個Rj
-
Initialize
-
Find an index i
Finish[i] == false
&& Requesti ≤ Work
- 如果 i 不存在,跳到4
-
可以執行
Work = Work + Allocation[i]
process釋放資源
Finish[i] = true
工作完成
- 回到2
-
If Finish[i] == false
, for some i, 1 ≤ i ≤ n, then the system is in deadlock state
Finish[i] == false
→ Pi is deadlocked
last edit
dotTue, Jul 28, 2020 11:04 PM
HOME PAGE 