

Difference between Deadlock and Starvation The process P2 can make a request for that resource R but it can't use that resource simultaneously with process P1.ĭeadlock will happen if all the above four conditions happen simultaneously. In other words, if a process P1 is using some resource R at a particular instant of time, then some other process P2 can't hold or use the same resource R at that particular instant of time.

So, you go to submit the tuition fees on the other counter and the accountant there said that you have to first submit the bus fees and then the tuition fees. Now, think of a situation, when you go for submitting the bus fee and the accountant says that you have to submit the tuition fee first and then the bus fee. Suppose, you are studying in a school and you are using the bus service also. Let's take one real-life example to understand the concept of Deadlock in a better way. If a process is in the waiting state and is unable to change its state because the resources required by the process is held by some other waiting process, then the system is said to be in Deadlock. This leads to infinite waiting and no work is done here. So, both are waiting for each other to release the resource. So, the process P1 is waiting for process P2 to release its resource and at the same time, the process P2 is waiting for process P1 to release its resource. At the same time, the process P2 is having the resource R2 and is waiting for the resource R1. Now, process P1 is holding the resource R1 and is waiting for the resource R2. For example, let us assume, we have two processes P1 and P2. If you are already familiar with deadlock and its four necessary conditions, then you can skip this blog and read What are Deadlock handling techniques in Operating System? What is Deadlock?ĭeadlock is a situation where two or more processes are waiting for each other. We will find what a Deadlock is and we will also see the four necessary conditions of Deadlock. Hope you all will enjoy this course.In this blog, we will learn one of the most important concepts of Operating System i.e. After completing this course, learner will be able to understand deadlock terminologies and will be able to solve problems based on Banker's algorithm example. Resource allocation graph method for handling deadlock avoidance in single instance resource system is also explained. It further explains safe state and Banker's algorithm with solved example. This course helps learner to understand concepts in deadlock handling methods. It includes explanation of the deadlock handling methods such as deadlock prevention and deadlock avoidance. It then explains four necessary conditions for deadlock to occur. This course starts with explanation of deadlock and how deadlocks happen. While performing these tasks, if process remain into wait state for infinite amount of time, then deadlock may occur. If resources are not available then process must wait, till it get allocated with requested resource. In scheduling, OS allocates requested resources to the processes, if they are available. Process management involves creation, scheduling and termination of process.

Process management is an important topic in study of operating system. This course explains basics of multi programmed operating system and deadlocks in operating system. Welcome to the course on topic "Deadlocks in Operating System".
