 Hello and welcome to the session on Distributed Deadlock Detection in Distributed Computing. Before we move forward, here are the learning outcomes. At the end of the session, students will be able to uniquely identify the preliminaries and deadlock handling strategies in Distributed Computing. Distributed System is a network of sites that exchange information with each other by message passing. It consists of computing and storage facilities and interface to local users and a communication network. Deadlocks is a fundamental problem in Distributed Systems. In Distributed Computing, a process can request and release resources in any order. The resources are local or remote, which may not be known a priori and a process can request some resources while holding others. If the sequence of allocation of resources to processes is not controlled in such environments, deadlocks can occur. If the sequence of allocation of resources to processes is not controlled in such environments, the deadlock can occur. Here we are going to discuss deadlock handling strategies in Distributed Computing. Deadlock Detection techniques based on various control organizations, preliminaries, the system model. The problem of deadlock in centralized system under a very general system model. Conditions for a deadlock and methods to handle deadlocks in various special cases that we discuss here. The problem of deadlocks has been generally studied in Distributed Computing under the following models. The systems have only reusable resources. Processes are allowed only exclusive access to resources. There is only one copy of each resource. A process can be in two states, running or blocked. In the running state, a process has all the needed resources and is either executed or is ready for execution. Running state is also called the active state. In the blocked state, a process is waiting to acquire some resources. Resource versus communication deadlock. Two types of deadlocks have been here resource deadlock and communication deadlock. In resource deadlocks, processes can simultaneously wait for several resources and cannot process until they have acquired all those resources. A set of processes is a resource deadlock. If each process in the set of request resource held by other processes in the set and it must receive all the requested resources before it can become unblocked. In the communication deadlocks, processes wait to communicate with other processes among a set of processes. A waiting process can unblock on receiving a communication from any one of these processes. A set of processes is communication deadlock. If each process in the set is waiting to communicate with another process in the set and no process in the set ever initiates any further communication until it receives the communication for which it is waiting. A graph-theoretic model. The state of process resource, the state of process resource interaction in distributed computing can be modeled by a directed graph called resource allocation graph. The nodes of this graph are processes and resources of a system and the edges of the graph depicts assignments or pending request. A pending request is represented by a request age directed from the node of a requesting process to the node of the requested resource. Resource assignment is represented by an assignment age directed from the node of an assigned resource to the node of the assigned process. A system is deadlocked if its resource allocation graph contains a directed cycle or not. Wait for graphs. In distributed computing system, the state can be modeled or represented by a directed graph called wait for graph. Also denoted as capital W F G. In wait for graph, nodes are processes and there is a direct age from node P1 to node P2. If P1 is blocked and is waiting for P2 to release some resource, a system is deadlocked if and only if there is a directed cycle or not in the wait for graph. In distributed database system, users access the data objects of the database by executing transactions. A transaction can be viewed as a process that performs a sequence of reads and writes on the data objects. The data objects of a database can be viewed as resources that are required and released by transactions. In distributed database system, a wait for graph is referred as transaction wait for graph. Also denoted as capital T W F. In transaction wait for graph, nodes are transactions and there is a directed age from node P1 to node P2. If P1 is blocked and is waiting for P2 to release some resource, a system is deadlocked if and only if there is a directed cycle or not in its transaction wait for graph. Here pause the video, think and answer. Which of the following is the visual way to determine the deadlock occurrence? Resource allocation graph, starvation graph, inversion graph and none of these. So the answer is A that is resource allocation graph. We can determine the deadlock occurrence. Here the deadlock handling strategies in distributed computing. There are three strategies to handle deadlocks. Deadlock prevention, deadlock avoidance, deadlock detection. Here you have to note that deadlock handling is complicated to implement in distributed computing because no one site has accurate knowledge of the current state of the system and because every intersite communication involves a finite and unpredictable delay and examination of the relative complexity and practicality of the three deadlock handling strategies in distributed computing are as follows. Deadlock prevention is commonly achieved by either having a process acquire all the needed resources simultaneously before it begins execution or by preempting a process that holds the needed resource. In the first method, a process request or release a remote resource by sending a request message or a release message to the site where the resource is located. This method has number of drawbacks. First it is inefficient as it decreases the system concurrency. In second method a set of processes can become deadlock in the resource acquiring phase. For example, suppose process P1 at site S1 and process P2 at site S2 simultaneously request two resources R3 and R4 located at site S3 and S4 respectively. It may happen that S3 grants R3 to P1 and S4 grants R4 to P2 which resulting in deadlock. This problem can be handled by forcing processes to acquire needed resources one by one and this approach is inefficient and impractical. Third method is that in many systems future resource requirements are unpredictable. Here is my reference. Thank you.