Professional Documents
Culture Documents
Critical Section Problem With Algorithm Solution
Critical Section Problem With Algorithm Solution
Critical Section Problem With Algorithm Solution
5 4
1 3
2 s Shared data
q q
Monitors
s A high-level abstraction that provides a convenient
at a time
monitor monitor-name { // shared variable declarations procedure P1 () { . } procedure Pn () {} Initialization code ( .) { } } }
Operating System Concepts 3.3
3.4
Condition Variables
s condition x, y;
q Allows
programmers to write their own synchronization schemes () a process that invokes the operation is suspended. () resumes one of processes (if any) that invoked x.wait ()
q x.signal
3.5
3.6
3.7
3.8
pickup() and putdown() in the following sequence: dp.pickup (i) EAT dp.putdown (i)
3.9