Barrier - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Barrier

Description:

turnstile = 0. 3. 2. 1. Barrier. 1 mutex.wait() 2 count -- 3 mutex.signal() 4 if count == 0: ... 5 turnstile.signal() 6 turnstile.wait() 7 turnstile.signal ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 33
Provided by: kevino3
Category:

less

Transcript and Presenter's Notes

Title: Barrier


1
Barrier
  • Kevin OGorman
  • CS 170
  • 22 April 2002

2
Barrier
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
3
Barrier
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
4
Barrier
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
5
Barrier
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
6
Barrier
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
7
Barrier
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
8
Barrier
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
9
Barrier
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
10
Barrier
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
11
Barrier
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
12
Barrier
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
13
Barrier
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
14
Barrier
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
15
Barrier
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
16
Barrier
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
17
Barrier
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
18
Barrier
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
19
Barrier
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
20
Barrier
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
21
Barrier
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
22
Barrier
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
23
Barrier
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
24
Barrier
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
25
Barrier
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
26
Barrier
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
27
Barrier
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
28
Barrier
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
29
Barrier
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
30
Barrier
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
31
Barrier
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)
Write a Comment
User Comments (0)
About PowerShow.com