Presentation is loading. Please wait.

Presentation is loading. Please wait.

While (lock = 1) wait Lock = 1 <critical section> Lock = 0 While (lock = 1) wait Lock = 1 <critical section> Lock = 0.

Similar presentations


Presentation on theme: "While (lock = 1) wait Lock = 1 <critical section> Lock = 0 While (lock = 1) wait Lock = 1 <critical section> Lock = 0."— Presentation transcript:

1

2 While (lock = 1) wait Lock = 1 <critical section> Lock = 0 While (lock = 1) wait Lock = 1 <critical section> Lock = 0

3 Loop1: While (turn != 1) wait <critical section> turn = 0 <noncritical section> GoToLoop1 Loop0: While (turn != 0) wait <critical section> turn = 1 <noncritical section> GoToLoop0

4 Interested[0]=T Turn = 0 [While (Turn = 0) and (Interested[1]=T) Wait] <critical section> Interested[0] = F Interested[1]=T Turn = 1 [While (Turn = 1) and (Interested[0]=T) Wait] <critical section> Interested[1] = F

5


Download ppt "While (lock = 1) wait Lock = 1 <critical section> Lock = 0 While (lock = 1) wait Lock = 1 <critical section> Lock = 0."

Similar presentations


Ads by Google