看板 Grad-ProbAsk 關於我們 聯絡資訊
Consider a computer system consisting of 4 resources of the type A and 4 resources of the type B that are shared by 3 processes. Type A and type B resources are boundled in the sense that a process always gets an A if it gets a B, and vice versa. Each of these processes requires no more than 2 resources of type A and 2 resources of type B. Is this system deadlock-free? Show proof for your answer. 這類題目我都是用鴿籠原理去想 如果是問答題好像比較難下筆 解答寫說: ΣMax[i] = 6 ΣMax[i] = ΣNeed[i] + ΣAllocation < 4 + 3 想問最後的不等式怎麼得到? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.230.126.34
christianSK:ΣMax[i] = ΣNeed[i] + ΣAllocation 08/21 15:48
christianSK:是假設所有資源被配置出去的情況下 08/21 15:48
christianSK:此時 ΣAllocation = m => ΣNeed[i] < n 08/21 15:49
christianSK:由鴿籠可以知道有人已經不需要資源 可順利完工 08/21 15:50
nypgand1:原來是這樣 我是直接想 "每人都不足1個時資源還有剩" 08/21 16:02
nypgand1:q是每個process最多要求 所以 n(q-1) < m 08/21 16:04
nypgand1:也就是說解答給的是 nq < m + n 囉? 08/21 16:04
christianSK:可以這樣想吧 08/21 17:24