[理工] 交大100年 資訊聯招 OS 題組C

看板Grad-ProbAsk作者 (派大星)時間10年前 (2016/01/17 20:58), 編輯推噓1(103)
留言4則, 2人參與, 最新討論串1/1
Hi 各位大大, 想請教一下 100年 交大 資訊聯招 OS 題組C 問題 題組C. Consider a system with five processes p0 through p4 and three resource type a,b and c. Resource type a has 10 instances,b has 5,c has 7.Suppose that,at time T0,the following snapshot of the system has been taken P0 allocation 0,1,0. Max 7,5,3 P1 allocation 2,0,0. Max 3,2,2 P2 allocation 3,0,2. Max 9,0,2 P3 allocation 2,1,1 Max 2,2,2 P4 allocation 0,0,2. Max 4,3,3 There are many possible safe sequences.Assume the number of possible safe sequences is Z. Z=Z3*5^3+Z2*5^2+Z1*5+Z0 0<=Z0~Z3<=5 答案是 z3=0,z2=0,z1=3,z0=1 想請問有人知道這題的答案是怎麼得出來的嗎? 煩請高手幫忙解釋 QQ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.251.43.80 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1453035520.A.35C.html

01/17 21:57, , 1F
列舉所有safe sqc. 我記得前面有人po過這題的算式
01/17 21:57, 1F

01/17 22:30, , 2F
我記得沒錯的話是3!+3!+2!吧,先把一定要先執行
01/17 22:30, 2F

01/17 22:30, , 3F
的列出來,剩下的不管順序如何一定會過,所以就用排
01/17 22:30, 3F

01/17 22:30, , 4F
序的下去帶就好
01/17 22:30, 4F
文章代碼(AID): #1Mcv00DS (Grad-ProbAsk)