|
|
Line 1: |
Line 1: |
| {{Unreferenced|date=December 2009}}
| | Myrtle Benny is how I'm called and I really feel comfy when people use the full title. Doing ceramics is what adore doing. Years in the past he moved to North Dakota and his family members enjoys it. Hiring is her working day occupation now and she will not change it anytime quickly.<br><br>my weblog ... [http://www.eyelevelfederalway.com/xe/index.php?mid=Promotions&page=1&document_srl=571267 eyelevelfederalway.com] |
| '''Maekawa's algorithm''' is an algorithm for [[mutual exclusion]] on a [[distributed system]]. The basis of this algorithm is a quorum like approach where any one site needs only to seek permissions from a subset of other sites.
| |
| | |
| ==Algorithm==
| |
| === Terminology ===
| |
| * A ''site'' is any computing device which is running the Maekawa's Algorithm
| |
| * For any one request of the critical section:
| |
| ** The ''requesting site'' is the site which is requesting entry into the critical section.
| |
| ** The ''receiving site'' is every other site which is receiving the request from the requesting site.
| |
| * ''ts'' refers to the local time stamp of the system according to its [[logical clock]].
| |
| | |
| ===Algorithm===
| |
| '''Requesting site''':
| |
| * A requesting site <math>P_i</math> sends a message <math>\text{request}(ts, i)</math> to all sites in its quorum set <math>R_i</math>.
| |
| | |
| '''Receiving site''':
| |
| * Upon reception of a <math>\text{request}(ts, i)</math> message, the receiving site <math>P_j</math> will:
| |
| ** If site <math>P_j</math> does not have an outstanding <math>\text{grant}</math> message (that is, a <math>\text{grant}</math> message that has not been released), then site <math>P_j</math> sends a <math>\text{grant}(j)</math> message to site <math>P_i</math>.
| |
| ** If site <math>P_j</math> has an outstanding <math>\text{grant}</math> message with a process with higher priority than the request, then site <math>P_j</math> sends a <math>\text{failed}(j)</math> message to site <math>P_i</math> and site <math>P_j</math> queues the request from site <math>P_i</math>.
| |
| ** If sites <math>P_j</math> has an outstanding <math>\text{grant}</math> message with a process with lower priority than the request, then site <math>P_j</math> sends an <math>\text{inquire}(j)</math> message to the process which has currently been granted access to the critical section by site <math>P_j</math>. (That is, the site with the outstanding <math>\text{grant}</math> message.)
| |
| * Upon reception of a <math>\text{inquire}(j)</math> message, the site <math>P_k</math> will:
| |
| ** 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>\text{yield}(k)</math> message, site <math>P_j</math> will:
| |
| ** 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.
| |
| ** 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.
| |
| | |
| '''Critical section''':
| |
| * Site <math>P_i</math> enters the critical section on receiving a <math>\text{grant}</math> message from all sites in <math>R_i</math>.
| |
| * 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>.
| |
| | |
| '''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>3 \sqrt{N}</math> to <math>6 \sqrt{N}</math>
| |
| * Synchronization delay: 2 message propagation delays
| |
| | |
| ==See also== | |
| * [[Lamport's bakery algorithm]]
| |
| * [[Lamport's Distributed Mutual Exclusion Algorithm]]
| |
| * [[Ricart-Agrawala algorithm]]
| |
| * [[Raymond's algorithm]]
| |
| | |
| ==References==
| |
| *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.
| |
| | |
| {{DEFAULTSORT:Maekawa's Algorithm}}
| |
| [[Category:Concurrency control algorithms]]
| |
Myrtle Benny is how I'm called and I really feel comfy when people use the full title. Doing ceramics is what adore doing. Years in the past he moved to North Dakota and his family members enjoys it. Hiring is her working day occupation now and she will not change it anytime quickly.
my weblog ... eyelevelfederalway.com