 Hello and welcome to the session on global state detection and hierarchical deadlock detection algorithm in distributed computing. Before we move forward, here are the learning outcomes. At the end of this session, students will be able to uniquely identify the functionalities of global state detection algorithm and hierarchical deadlock detection algorithm in distributed computing. Shem Kalyani and single algorithm has a single phase. It is a single phase algorithm which consists of a fan out sweep of message outwards from an initiator process and a fan in sweep of messages inwards to the initiator process. A sweep is a traversal of the wait for graph in which all messages are sent in the direction of the wait for graph edges or all messages are sent against the direction of the WFG edges. In the outwards sweep, the algorithm records a snapshot of a distributed WFG. In the inward sweep, the recorded distributed WFG is reduced to determine if the initiator is deadlocked. Both the outward and the inward sweeps are executed concurrently in the algorithm. Complications are introduced because the two sweeps can overlap in time at a process. That is, the reduction of the wait for graph at a process can begin before the wait for graph at that process has been completely recorded system model. The system has n nodes and every pair of nodes is connected by a logical channel. Every events are assigned time stamps using lamports clock. The computation messages can be either request, reply or cancel messages. To execute a p out of q request, an active node i sends a request to other nodes and remains blocked until it receives sufficient number of reply messages. When node i blocks on node j, node j becomes a successor of node i and node i becomes a predecessor of node j in the wait for graph. A reply message denotes the granting of a request. A node i unblocks when p out of its q request have been granted. When a node unblocks, it sends cancel message to withdraw the remaining q and p request it had sent. Sending and receiving of request, reply and cancel messages are computation events. The sending and receiving of deadlock detection algorithm messages are algorithmic or control events. Informal description of the algorithm. When a node init blocks on a p out of q request, it initiates the deadlock detection algorithm. The algorithm records part of a wait for graph that is reachable from init in a distributed snapshot. The distributed wait for graph is recorded using flood message in the outward sweep and recorded wait for graph is examined for deadlocks using eco message in the inward sweep. To detect a deadlock, the initiator init records its local state and sends flood messages along all of its outward dependencies. When a node i receives the first flood message along an existing inward dependency, it records its local state. If node i is blocked at this particular time, it sends out flood messages along all of its outward dependencies to continue the recording of the wait for graph in the outward sweep. If node i is active at this particular time, then it initiates reduction of the wait for graph by returning an eco message along the incoming dependency even before the state of all incoming dependencies have recorded in the wait for graph snapshot at the leave node. Eco messages perform reduction of the recorded wait for graph by simulating the granting of request in the inward sweep. A node i in the wait for graph is reduced if it is received, echoes along p i out of its q i outgoing edges indicating that p i of its request can be granted. An edge is reduced if an echo is received on the edge indicating that the request it represents can be granted. The nodes that can be reduced do not form a deadlock whereas the nodes that cannot be reduced are deadlocked. Node init detects the deadlock if it is not reduced when the deadlock detection algorithm terminates. Termination detection The algorithm requires a termination detection technique so that the initiator can determine it will not receive any more eco messages. The algorithm uses termination detection technique based on waits in co-junction with short messages to detect the termination of the algorithm. A wait of 1.0 at the initiator node when the algorithm is initiated is distributed among all flood messages sent by the initiator. When the first flood is received at a non-lift node the wait of the received flood is distributed among the floods sent out along outward edges at that node to expand the wait for graph. Here pause the video think and answer a state in which a process has finished its computation and will not restart any action unless it receives a message is called as locally terminated state hierarchical deadlock detection algorithms. In hierarchical algorithms logically arranged in hierarchical fashion and a site is responsible for deadlock detection involving all its children site. These algorithms take advantage of process. These algorithms takes advantage of access patterns that are localized to a cluster of its to optimize performance. The menace moons algorithm In the hierarchical deadlock detection algorithm of menace moons all the controllers are arranged in the tree fashion. The controller at the bottom most level called leaf controllers manage resources and other are called non-lift controllers which are responsible for deadlock detection. A leaf controller maintains a part of the global TWF graph concerned with the allocation of the resources at that leaf controller. A leaf a non-lift controller maintains all TWF graphs spanning its children controllers and is responsible for detecting odd deadlocks involving all of its lift controller. Whenever the change occurs in a controller TWF graph due to a resource allocation wait for release it is propagated to its parent controller. The parent controller makes changes in its TWF graph and searches for cycles and propagates the change upwards if necessary. Leaf controller can receive up to date information concerning TWF graph of its children continuously. The Ho-Ram-Murthy algorithm In the hierarchical algorithm of Ho-Ram-Murthy sites are groups into several disjoint clusters as you can see in the figure. Periodically a site is chosen as a central control site which dynamic light uses a control site for each cluster as shown in figure. The central control site request from every control site their inter cluster transactions, status information and wait for relations. As a result the control site collects status table from all sites in its cluster and applies the one phase deadlock detection algorithm to detect all deadlocks involving only inter cluster transactions. Then it sends inter cluster transaction status information and wait for relations to the central control site. Central control site splices the inter cluster information it receives, constructs a system wait for graph and searches for cycles. Control site details all deadlocks located in its cluster and the central control site details all inter cluster deadlocks as shown in the figure. Here is the reference. Thank you.