Lamport's bakery algorithm [SEP] named after
Lamport's bakery algorithm
Lamport's bakery algorithm is a computer algorithm devised by computer scientist Leslie Lamport, which is intended to improve the safety in the usage of shared resources among multiple threads by means of mutual exclusion.
In computer science, it is common for multiple threads to simultaneously access the same resources. Data corruption can occur if two or more threads try to write into the same memory location, or if one thread reads a memory location before another has finished writing into it. Lamport's bakery algorithm is one
times without receiving permission from formula_4 on subsequent attempts up to the moment when formula_2 has sent a formula_3 message to formula_4. This is called Roucairol-Carvalho optimization or Roucairol-Carvalho algorithm.
Algorithm Problems.
One of the problems in this algorithm is failure of a node. In such a situation a process may starve forever.
This problem can be solved by detecting failure of nodes after some timeout.
See also.
- Lamport's Bakery Algorithm
- Lamport's Distributed Mutual Exclusion Algorithm
- Maekawa's