Operating Systems: Syed Mansoor Sarwar
Operating Systems: Syed Mansoor Sarwar
Systems
Lecture 20
Syed Mansoor Sarwar
Agenda for Today
Review of previous lecture
2-Process Critical Section
Problem (continued)
n-Process Critical Section
Problem
The Bakery Algorithm
Recap of lecture
14 September 2019 © Copyright Virtual University of
Pakistan
Review of Lecture 19
Process Synchronization
The Critical Section Problem
number[i] = 0;
remainder section
} while (1);
P0 P2 P3 P4
(3,0) < (3,0) (3,0) < (7,2) (3,0) < (4,3) (3,0) < (8,4)
(7,2) < (3,0) (7,2) < (7,2) (7,2) < (4,3) (7,2) < (8,4)
(4,3) < (3,0) (4,3) < (7,2) (4,3) < (4,3) (4,3) < (8,4)
(8,4) < (3,0) (8,4) < (7,2) (8,4) < (4,3) (8,4) < (8,4)
14 September 2019 © Copyright Virtual University of
Pakistan
Recap of Lecture
n-Process Critical Section
Problem
The Bakery Algorithm