Maekawa's algorithm: Difference between revisions

Content deleted Content added
Line 17:
** 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 sitesites <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>.