Dijkstra–Scholten algorithm
Appearance
The Dijkstra-Scholten Algorithm is an algorithm for detecting termination in a distributed system. The algorithm was proposed by Dijkstra and Scholten in 1980.
Algorithm
Dijkstra-Scholten's algorithm is a tree-based algorithm which can be described by the following:
- The initiator of a computation is the root of the tree.
- Upon receiving a computational message:
- If the receiving process is currently not in the computation: the process joins the tree by becoming a child of the sender of the message. (No acknowledgement message is sent at this point.)
- If the receiving process is already in the computation: the process immediately sends an acknowledgement message to the sender of the message.
- When a process has no more children and has become idle, the process detaches itself from the tree by sending an acknowledgement message to its tree parent.
- Termination occurs when the initiator has no children and has become idle.