[理工] [OS] Dead Lock
洪逸 作業系統金寶典
p.5-59
47.Consider a snapshit if the system as shown below. Upon the
next request, P1 makes a request for ( 0 4 2 0) and is granted
immediately. What is the minimum number of initial instances
(i.e. the total number of instances before any [rpcess enters the
system) for each resource type to make sure system still in a
safe after P1's request is granted? (答案請以(a b c d) 方式表示)
Allocation Max
A B C D A B C D
P0 0 0 1 2 0 1 1 2
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 4 5 6
P3 0 4 3 2 0 7 5 2
P4 0 0 1 4 0 6 5 6
Ans:
Need
A B C D
P0 0 1 0 0
P1 0 7 5 0
P2 1 1 0 2
P3 0 3 2 0
P4 0 6 4 2
所以最少 = (3,12,12,12)
這題我嘗試過各種算法,
都解不出這個數字呀Q___Q
是要用到定理那兩個算式嗎? (Maxi <= m , Maxi總合 < n+m這兩個...)
請大大解決
謝謝!!!!!!!!!!!!!
--
Why Not :-P
http://whynot-p.blogspot.com/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.248.50.179
※ 編輯: mickeyha 來自: 111.248.50.179 (11/01 23:11)
→
11/02 00:07, , 1F
11/02 00:07, 1F
→
11/02 00:10, , 2F
11/02 00:10, 2F
→
11/02 00:10, , 3F
11/02 00:10, 3F
→
11/02 00:11, , 4F
11/02 00:11, 4F
→
11/02 00:13, , 5F
11/02 00:13, 5F
→
11/02 00:14, , 6F
11/02 00:14, 6F
→
11/02 00:15, , 7F
11/02 00:15, 7F
→
11/02 00:15, , 8F
11/02 00:15, 8F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):