Lamport's distributed mutual exclusion algorithm: Difference between revisions
Appearance
Content deleted Content added
Line 32: | Line 32: | ||
==See also== |
==See also== |
||
* [[Ricart-Agrawala algorithm]] |
* [[Ricart-Agrawala algorithm]] (an improvement over Lamport's algorithm) |
||
* [[Lamport's bakery algorithm|Lamport's Bakery Algorithm]] |
* [[Lamport's bakery algorithm|Lamport's Bakery Algorithm]] |
||
* [[Raymond's Algorithm]] |
* [[Raymond's Algorithm]] |
Revision as of 22:04, 19 June 2012
Lamport's Distributed Mutual Exclusion Algorithm is a contention-based algorithm for mutual exclusion on a distributed system.
Algorithm
Nodal properties
- Every process maintains a queue of pending requests for entering critical section order. The queues are ordered by virtual time stamps derived from Lamport timestamps.[1]
Algorithm
Requesting process
- Enters its request in its own queue (ordered by time stamps)
- Sends a request to every node.
- Wait for replies from all other nodes.
- If own request is at the head of the queue and all replies have been received, enter critical section.
- Upon exiting the critical section, send a release message to every process.
Other processes
- After receiving a request, send a reply and enter the request in the request queue (ordered by time stamps)
- After receiving release message, remove the corresponding request from the request queue.
- If own request is at the head of the queue and all replies have been received, enter critical section.
Message complexity
This algorithm creates 3(N − 1) messages per request, or (N − 1) messages and 2 broadcasts.
Drawbacks
- There exist multiple points of failure.
See also
- Ricart-Agrawala algorithm (an improvement over Lamport's algorithm)
- Lamport's Bakery Algorithm
- Raymond's Algorithm
- Maekawa's Algorithm
- Suzuki-Kasami's Algorithm
- Naimi-Trehel's Algorithm
References
- ^ Kshemkalyani, A., & Singhal, M. Chapter 9: Distributed Mutual Exclusion Algorithms. Distributed Computing: Principles, Algorithms, and Systems (Page 10 of 93). Cambridge University Press.