6.6 Silberschatz, Galvin and Gagne
©2009
Operating System Concepts – 8
th
Edition
Bakery Algorithm
Process Number
P0 3
P1 0
P2 7
P3 4
P4 8
P0 P2 P3 P4
(3,0) < (3,0)(3,0) < (7,2)(3,0) < (4,3)(3,0) < (8,4)
Number[1] = 0Number[1] = 0Number[1] = 0Number[1] = 0
(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)
1 3 2 4