Content deleted Content added
new |
Link suggestions feature: 2 links added. |
||
(65 intermediate revisions by 42 users not shown) | |||
Line 1:
'''Maekawa's
== Algorithm ==▼
=== Terminology ===
* A ''site'' is any computing device which
* For any one request of entering the [[critical section]]:
** The ''requesting site'' is the site which is requesting
** The ''receiving site'' is every other site which is receiving the request from the requesting site.
* ''ts'' refers to the local
===
'''Requesting
* A requesting site <math>P_i</math> sends a message <math>\text{request}(ts, i)</math> to all sites in its
* Upon reception of a <math>
▲'''Receiving Site''':
**
** If site <math>P_j</math>
** If site <math>P_j</math> has an outstanding <math>\text{grant}</math> message with a process with
* Upon reception of a <math>
** Send a <math>\text{yield}(k)</math> message to site <math>P_j</math> [[if and only if]] site <math>P_k</math> has received a <math>\text{failed}</math> message from some other site or if <math>P_k</math> has sent a yield to some other site but have not received a new <math>\text{grant}</math>.▼
▲* Upon reception of a <math>inquire(j)</math> message, the site <math>P_k</math> will:
* Upon reception of a <math>\text{yield}(k)</math> message, site <math>P_j</math> will:
▲** Send a <math>yield(k)</math> message to site <math>P_j</math> if and only if site <math>P_k</math> has received a <math>failed</math> message from some other site or if <math>P_k</math> has sent a yield to some other site but have not received a new <math>grant</math>.
** Send a <math>\text{grant}(j)</math> message to the request on the top of its own request queue. Note that the requests at the top are the highest priority.▼
▲* Upon reception of a <math>yield(k)</math> message, site <math>P_j</math> will:
▲** Send a <math>grant(j)</math> message to the request on the top of its own request queue.
** Place <math>P_k</math> into its request queue.
* Upon reception of a <math>\text{release}(i)</math> message, site <math>P_j</math> will:
** Delete <math>P_i</math> from its request queue.
** Send a <math>\text{grant}(j)</math> message to the request on the top of its request queue.
* Site <math>P_i</math> enters the critical section on
* Upon exiting the critical section, <math>P_i</math> sends a <math>\text{release}(i)</math> message to all sites in <math>R_i</math>.▼
▲'''Critical Section''':
▲* Site <math>P_i</math> enters the critical section on reciving a <math>grant</math> message from all sites in <math>R_i</math>.
▲* Upon exiting the critical section, <math>P_i</math> sends a <math>release(i)</math> message to all sites in <math>R_i</math>.
▲'''Quorum Set (<math>R_x</math>)''':<br />
A quorum set must abide by the following properties:
# <math>\forall i \,\forall j\, [R_i \bigcap R_j \ne \empty ]</math>
# <math>\forall i\, [ P_i \in R_i ]</math>
# <math>\forall i\, [ |R_i| = K ]</math>
# Site <math>P_i</math> is contained in exactly <math>K</math> request sets
:Therefore: <math>|R_i| \geq \sqrt{N-1}</math>
===Performance===
* Number of network messages; <math>
* The algorithm can deadlock without protections in place.<ref>{{Cite web|url=https://www.risc.jku.at/software/daj/Maekawa/|title=Maekawa's Mutual Exclusion Algorithm: Voting approach|last=|first=|date=|website=|access-date=}}</ref><ref>{{Cite web|url=https://www.cs.cmu.edu/~dga/15-440/F09/lectures/Distributed-Mutual-Exclusion-slides.pdf|title=Distributed Mutual Exclusion|last=|first=|date=|website=|access-date=}}</ref>
* [[Lamport's Distributed Mutual Exclusion Algorithm]]▼
* [[Ricart–Agrawala algorithm]]
==
{{Reflist}}
▲* Synchronization Delays: Two message propagation delay
* M. Maekawa, "A √N algorithm for mutual exclusion in decentralized systems”, ACM
Transactions in Computer Systems, vol. 3., no. 2., pp. 145–159, 1985.
* Mamoru Maekawa, Arthur E. Oldehoeft, Rodney R. Oldehoeft (1987). Operating Systems: Advanced Concept. Benjamin/Cummings Publishing Company, Inc.
* B. Sanders (1987). The Information Structure of Distributed Mutual Exclusion Algorithms. ACM Transactions on Computer Systems, Vol. 3, No. 2, pp. 145–59.
▲== See Also ==
[[Category:Concurrency control algorithms]]
▲* [[Lamport's bakery algorithm|Lamport's Bakery Algorithm]]
▲* [[Lamport's Distributed Mutual Exclusion Algorithm]]
▲* [[Maekawa's Algorithm]]
▲* [[Raymond's Algorithm]]
|