Lamport's Distributed Mutual Exclusion Algorithm - Algorithm - Algorithm

Algorithm

Requesting process

  1. Enters its request in its own queue (ordered by time stamps)
  2. Sends a request to every node.
  3. Wait for replies from all other nodes.
  4. If own request is at the head of the queue and all replies have been received, enter critical section.
  5. Upon exiting the critical section, send a release message to every process.

Other processes

  1. After receiving a request, enter the request in the request queue (ordered by time stamps) and reply with a time stamp.
  2. After receiving release message, remove the corresponding request from the request queue.
  3. 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