CSTC Banner

 CSTC home --> browse resources --> cover page --> content

Ricart-Agrawala Mutual Exclusion

Mordechai (Moti) Ben-Ari

Instructions

Recommendation: Your monitor resolution should be at least 800x600.

This is a generalized "bakery algorithm" for mutual exclusion.

If you want a process to enter its critical section, you must choose a ticket number and send a request message to the other nodes. The ticket number must be greater than the number of any request received so far.

When a node has received a request, you must send a reply message if the ticket number of the node is higher than the number in the request or if the node does not want to enter its critical section. Otherwise, the reply will be listed as deferred, and you must send it only after the node has completed its critical section.

This applet checks the correctness of your sequence of steps: it ensures that you choose a ticket number that is large enough, and it keeps track of which replies need be made and which are to be deferred.

Your browser does not support java applets. Your browser does not support java applets.
Your browser does not support java applets. Your browser does not support java applets.