作者yesa315 (XD)
看板Grad-ProbAsk
标题[理工] [OS]-死结
时间Thu Oct 8 10:23:03 2009
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
1F:推 svanavs:m = n*(k-1)+1 10/08 10:36
2F:→ yesa315:打错了@@ 10/08 11:13
※ 编辑: yesa315 来自: 140.127.208.96 (10/08 11:13)