[理工] [OS]-死結
Consider a system consisting of m resources of the same type that are
shared by n processes,each of which needs at most k resources. Please show
the condition such tbat the system is guaranteed to be deadlock-free.
Briefly explain why your condition can guarantee a deadlock-free system.
這題要怎麼寫比較恰當呢?
解答寫
1<= K <=m n*k < m + n
然後附上此定理的證明 可是這題才6分
所以我想說 就依鴿籠來講 m resources ,n processes 則
當 m = n*(k-1) + 1 時 必有一個process可恰持有k resources
則此系統必不會進入死結 繼續執行下去
不知道此方法可行嗎
謝謝指導!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.127.208.96
推
10/08 10:36, , 1F
10/08 10:36, 1F
→
10/08 11:13, , 2F
10/08 11:13, 2F
※ 編輯: yesa315 來自: 140.127.208.96 (10/08 11:13)
討論串 (同標題文章)