Lamport Baker
Lamport Baker
A A
A C
0
2 1
0 0
2 1
2 1 2 1
0 0
0 0
2 1 2 1
0 0
C B C
0 0
2 1 2 1
2 1 2 1 2 1 2 1
A B A
B moves
Three Thread Bounded Precedence Graph
C
0 0
0 0
2 1 2 1
0 0
C
0 0
2 1 2 1
2 1 2 1 2 1 2 1
A B A B
C moves
n Thread Bounded Precedence Graph
And so on … 0
0
n thread graph size is 3n-1 (!) 2 1
0 0
2 1
2 1 2 1
0 0
0 0
2 1 2 1
0 0 0 0
2 1 2 1
2 1 2 1 2 1 2 1
So Is the Bakery Algorithm the Way to Go?
• The Bakery Algorithm is
– Succinct,
– Elegant, and
– Fair.
• Q: So why isn’t it praccal?
• A: Well, you have to read n disnct variables
Art of Multiprocessor
57
Programming