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, enter the request in the request queue (ordered by time stamps) and reply with a time stamp.
- 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.
Read more about this topic: Lamport's Distributed Mutual Exclusion Algorithm, Algorithm