Si, I.E. The Set of Sites From Which S N:: Ri (S1, S2,..., SN) - Every Site Si
Si, I.E. The Set of Sites From Which S N:: Ri (S1, S2,..., SN) - Every Site Si
The Algorithm
When a site removes a request from its request queue, its own request
may come at the top of the queue, enabling it to enter CS. The algorithm
executes CS requests in the increasing order of timestamps.
The Ricart-Agrawala Algorithm
The Algorithm
1. When site Si exits the CS, it sends REPLY messages to all the deferred
requests.
A site's REPLY messages are blocked only by sites that are requesting the CS
with higher priority (i.e., a smaller timestamp). Thus, when a site sends out
REPLY messages to all the deferred requests, the site with the next highest
priority request receives the last needed REPLY message and enters the CS. The
execution of CS requests in this algorithm is always in the order of their
timestamps.
Maekawa's Algorithm
The Construction of request sets. The request sets for sites in Maekawa's
algorithm are constructed to satisfy the following conditions:
M1: (∀i ∀j : i≠j, 1 ≤ i, j ≤ N :: Ri ∩ Rj ≠ Φ ).
M2: ((∀i : 1 ≤ i ≤ N:: Si ∈ Ri)
M3: (((∀i : 1 ≤ i ≤ N:: |Ri | = K)
M4: Any site Sj is contained in K number of Ris, 1 ≤ i, j ≤ N.
The Algorithm
Releasing the critical section. Having finished the execution of the CS, site Si
takes the following actions:
1. It sets LN[i] element of the token array equal to RNi[i].
2. For every site Sj whose ID is not in the token queue, it appends its ID to the
token queue if RNi[j]=LN[j]+1.
3. If token queue is nonempty after the above update, then it deletes the top site
ID from the queue and sends the token to the site indicated by the ID.
Raymond's Tree-Based Algorithm
The Algorithm
Releasing the critical section. After a site has finished execution of the CS, it
takes the following actions:
1. If its request_q is nonempty, then it deletes the top entry from its request_q,
sends the token to that site, and sets its holder variable to point at that site.
2. If the request_q is nonempty at this point, then the site sends a REQUEST
message to the site which is pointed at by the holder variable.