Termination Detection for Diffusing Computations

This chapter presents a distributed program that uses a fifo channel and implements the termination-detection channel in Chap. 14 over the addresses of the fifo channel for the case where only one user is active initially. Such a distributed computation is referred to as a “diffusing” computation (because it “diffuses” out from the initially active user). The program employs the Dijkstra-Scholten algorithm, which is itself a diffusing computation. It maintains a distributed dynamic tree that includes all active users and is rooted at the user that is initially active. The tree grows whenever a user not on the tree becomes active and shrinks whenever a user at a leaf of the tree becomes inactive. Termination is detected by the user that was initially active when that user finds the tree to be empty. Because trees have many uses in distributed computing (just as in sequential computing), the distributed tree-growing algorithm underlying the solution is a useful building block of distributed programs.