In a distributed system, all processes are logically formed into a ring, and each process first knows who its next process is (often more commonly, it should be that each process maintains a record and knows all the other processes behind it so that it can pass the token to its successor when its direct successor crashes). Further passed on to its successor);
When the ring is initialized, process 0 gets a token (which can be understood as a mutex), which is passed along the ring, and when the process obtains the token, it first checks to see if it has the need to access the shared resource and, if necessary, accesses the resource, passes the token after the access is complete, and, if no access is required, The token is passed directly to its successor. As shown in 1. To enhance reliability, we require that when a token is passed to the next process, it is asked to reply back to the confirmation message if
No acknowledgement is returned and the node is considered to be crashing, at which point the token is passed to the successor.
---token Ring algorithm for distributed system mutual exclusion algorithm