[理工] [OS] - critical section problem

看板Grad-ProbAsk作者 (祈附‧征前御祭)時間15年前 (2010/08/20 16:25), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/6 (看更多)
var flag: array[0..1] of Boolean; (initailly false) turn: 0..1; (initailly 1) The following program is for process Pi (i = 0 or 1), with Pj (j = 1 or 0) being the other process repeat flag[i]:=ture; while turn < > i do begin while flag[j] do no-op; turn:=i; end //critical section flag[i]:=false; //remainder section until fasle; 類似像這樣給code然後要求證明 mutual exclusive、progress、bounded waiting 這三個的題目蠻多的 變化也很多 想問說這類的題目有沒有什麼解題技巧? 如果沒有的話 純解這題也可以 謝謝!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.230.126.34
文章代碼(AID): #1CRZmBW4 (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1CRZmBW4 (Grad-ProbAsk)