看板 Grad-ProbAsk 關於我們 聯絡資訊
Pi Pj do{ do{ T6 T0 flag[i] = true; T3 flag[j] = true; T1 while(falg[j]); T7 T4 while(flag[i]); T2 CS CS T5 flag[i] = false; flag[j] = false; RS RS }while(true); }while(true); T0 ~ T7 為執行次序 請問為何符合bounded waiting 如上所標 不就讓Pj 餓死了嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 180.177.41.177 ※ 編輯: onlyeric23 來自: 180.177.41.177 (01/12 22:24)
pikachu123:你這樣就先deadlock好嗎 大家都進步去 01/12 22:28
rayway30419:Pj沒有讓Pi怎麼進CS的? 01/12 22:34
onlyeric23:還是不懂orz 01/12 23:08
pikachu123:你都deadlock哪來starvation bouded waiting 01/12 23:09
pikachu123:不滿足是指 pi可以一直進 你這個狀況 是大家都進步去 01/12 23:10
pikachu123:flag[i] flag[j]都是true不就互卡了 01/12 23:10
pikachu123:bounded waiting滿足是因為 pi一離開CS 01/12 23:11
pikachu123:flag[i]馬上改false所以Pj就可以進去不是 01/12 23:12
pikachu123:Pi進入CS離開後不可能先於Pj進入 01/12 23:13
onlyeric23:gosh 懂了 這段真的苦手 感謝 01/12 23:24
sneak: bounded wai https://daxiv.com 09/11 14:45