Lamport's Distributed Mutual Exclusion Algorithm
From Wikipedia, the free encyclopedia
Lamport's Distributed Mutual Exclusion Algorithm is a contention based algorithm for mutual exclusion on a distributed system.
Contents |
[edit] Algorithm
[edit] Nodal Properties
- Every process maintains a queue of pending requests for entering critical section ordered according to the logical time-stamp.
[edit] Algorithm
Requesting Process
- Enters its request in its own queue.
- 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
- 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.
[edit] Message Complexity
This algorithm creates 3(N-1) messages per request.
[edit] Drawbacks
- There exist multiple points of failure.
[edit] See also
- Ricart-Agrawala algorithm
- Lamport's Bakery Algorithm
- Raymond's Algorithm
- Maekawa's Algorithm
- Suzuki-Kasami's Algorithm
- Naimi-Trehel's Algorithm