The Suzuki–Kasami algorithm is a
token
Token may refer to:
Arts, entertainment, and media
* Token, a game piece or counter, used in some games
* The Tokens, a vocal music group
* Tolkien Black, a recurring character on the animated television series ''South Park,'' formerly known as ...
-based
algorithm
In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
for achieving
mutual exclusion
In computer science, mutual exclusion is a property of concurrency control, which is instituted for the purpose of preventing race conditions. It is the requirement that one thread of execution never enters a critical section while a concurr ...
in
distributed systems
Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different computer network, networked computers.
The components of a distribu ...
. The process holding the token is the only process able to enter its
critical section
In concurrent programming, concurrent accesses to shared resources can lead to unexpected or erroneous behavior. Thus, the parts of the program where the shared resource is accessed need to be protected in ways that avoid the concurrent access. One ...
.
This is a modification to
Ricart–Agrawala algorithm
The Ricart–Agrawala algorithm is an algorithm for mutual exclusion on a distributed system. This algorithm is an extension and optimization of Lamport's Distributed Mutual Exclusion Algorithm, by removing the need for release messages. It was d ...
[Ricart, Glenn, and Ashok K. Agrawala.]
An optimal algorithm for mutual exclusion in computer networks
" Communications of the ACM 24.1 (1981): 9-17. in which a REQUEST and REPLY message are used for attaining the critical section, but in this algorithm, a method was introduced in which a seniority vise and also by handing over the critical section to other node by sending a single PRIVILEGE message to other node. So, the node which has the privilege it can use the critical section and if it does not have one it cannot. If a process wants to enter its critical section and it does not have the token, it broadcasts a request message to all other processes in the system. The process that has the token, if it is not currently in a critical section, will then send the token to the requesting process. The algorithm makes use of increasing Request Numbers to allow messages to arrive out-of-order.
Algorithm description
Let
be the number of processes. Each process is identified by an integer in
.
Data structures
Each process maintains one data structure:
* an array