Locking and Returning LOCKED message
- When a member node of Si receives a REQUEST message, it checks if it is currently locked for another REQUEST. If it is not locked, it marks itself as locked for the received REQUEST and sends a LOCKED message back to the requesting node i.
- However, if the node is already locked for a REQUEST from another node, the received REQUEST from node i is placed in the WAITING QUEUE of the node. These REQUEST messages in the WAITING QUEUE are referred to as outstanding REQUESTS.
Determining Precedence and Returning FAILED message
- The node then tests whether the current locking REQUEST or any other outstanding REQUEST at the node precedes the received REQUEST. Precedence is determined based on the sequence number and node number of the REQUESTs.
- If any REQUEST at the node precedes the received REQUEST, a FAILED message is returned to node i, indicating that the received REQUEST cannot be granted at this time.
Sending INQUIRE message
- If the received REQUEST is not preceded by any other REQUEST at the node, an INQUIRE message is sent to the node that originated the current locking REQUEST. The purpose of the INQUIRE message is to inquire whether the originating node has successfully locked all its members.
- However, if an INQUIRE message has already been sent for a previous REQUEST and its reply message (either RELINQUISH or RELEASE) has not yet been received, there is no need to send another INQUIRE message.
Definition of Locking REQUEST and WAITING QUEUE
- Each node can be locked by only one REQUEST at a time, and this REQUEST is referred to as the locking REQUEST.
- Any subsequent REQUESTS that arrive at the node are placed in the WAITING QUEUE of the node. The REQUESTS in the WAITING QUEUE are ordered in decreasing order of precedence, as defined earlier.
It uses Lamport clock1.