Lamport's distributed mutual exclusion algorithm
Appearance
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 ordered according to the logical time-stamp.
Algorithm
Requesting Process
- Sends a request to every process.
- After all replies are collected, enter its own request in its own queue
- If own request is at the head of the queue, 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 queue
- After receiving release message, remove the corresponding request from the queue.
- If own request is at the head of the queue, enter critical section.
Message Complexity
This algorithm creates 3(N-1) messages per request.
Drawbacks
- There exist multiple points of failure.