Title: Barrier
1Barrier
- Kevin OGorman
- CS 170
- 22 April 2002
2Barrier
3
2
1
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 3
mutex 1
turnstile 0
3Barrier
3
2
1
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 3
mutex 1
turnstile 0
4Barrier
3
2
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
1
count 3
mutex 0
turnstile 0
5Barrier
3
2
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 2
1
mutex 0
turnstile 0
6Barrier
3
2
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 2
mutex 1
1
turnstile 0
7Barrier
3
2
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 2
mutex 1
turnstile 0
1
8Barrier
3
2
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 2
mutex 1
turnstile -1
1
9Barrier
3
2
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 2
mutex 1
turnstile -1
1
10Barrier
3
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
2
count 2
mutex 0
turnstile -1
1
11Barrier
3
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 1
2
mutex 0
turnstile -1
1
12Barrier
3
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 1
mutex 1
2
turnstile -1
1
13Barrier
3
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 1
mutex 1
turnstile -1
2
1
14Barrier
3
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 1
mutex 1
turnstile -2
2
1
15Barrier
3
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 1
mutex 1
turnstile -2
2
1
16Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
3
count 1
mutex 0
turnstile -2
2
1
17Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
3
mutex 0
turnstile -2
2
1
18Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
3
turnstile -2
2
1
19Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile -2
3
2
1
20Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile -1
3
2
1
21Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile -2
3
2
1
22Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile -2
3
2
1
23Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile -1
3
2
1
24Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile -1
3
2
1
25Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile -1
3
2
1
26Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile 0
3
2
1
27Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile 0
3
2
1
28Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile 0
3
2
1
29Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile 1
3
2
1
30Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile 1
3
2
1
31Barrier
1 mutex.wait() 2 count -- 3
mutex.signal() 4 if count 0 5
turnstile.signal() 6 turnstile.wait() 7
turnstile.signal()
count 0
mutex 1
turnstile 1
Success!!
3
2
1
32(No Transcript)