5. Predavanje - VTS NS
5. Predavanje - VTS NS
5. Predavanje - VTS NS
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Uposleno čekanjePokušaj rešenja 1:process P1beginloopflag1 := true; (* Announce intent to enter *)while flag2 = true do null end; (* Busy wait *) (* Critical section *)flag1 := false; (* Exit protocol *)endend P1;Problem: živo blokiranje (livelock)process P2beginloopflag2 := true; (* Announce intent to enter *)while flag1 = true do null end; (* Busy wait *) (* Critical section *)flag2 := false; (* Exit protocol *)endend P2;52/285