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 2:process P1beginloopwhile flag2 = true do null end; (* Busy wait *)flag1 := true; (* Critical section *)flag1 := false; (* Exit protocol *)endend P1;process P2beginloopProblem: ne obezbeđuje međusobnoisključenje zbog utrkivanja (racecondition)while flag1 = true do null end; (* Busy wait *)flag2 := true; (* Critical section *)flag2 := false; (* Exit protocol *)endend P2;53/285