Das Video kommt von YouTube: erst beim Abspielen verbindet sich die Seite mit YouTube (Google).
Deadlock in Operating System | GeeksforGeeks
Das Wichtigste aus dem Video
Tipp auf eine Zeit – das Video springt genau dorthin.
Transkriptautomatisch erstellt · 32 Zeilen
- Hello and welcome to Geeks for Geeks. In this video, we are going to understand a very important concept of deadlock in operating systems in a simple manner
- with the help of some real-life examples. So, let us understand deadlock by a real-life example. You can't get a job without experience and experience
- can only come when you do some job. So, here we end up in a deadlock. Let's see a formal definition of deadlock. So, deadlock is a situation
- where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process.
- Let us understand it with the help of an example. So, in this example, process one is waiting for resource Y but it is assigned to process two.
- Process two is not getting completed because it requires resource X which is assigned to process one ending up in a deadlock situation. Let's understand
- deadlock with one more real-life example of a wrongly managed school. The school never performs good in board exams. Almost all the students get failed. When
- the principal is asked why, his straightforward answer is that teachers doesn't teach well. When the teachers were asked about why the
- students were getting failed, they said that they were not given their wages. Then again, when the principal was asked why they are not giving the wages, he
- replies that parents don't want to pay the fees and he does not have the funds to give them. Pay to the teachers.
- The parents give the reason that school does not provide enough facilities but obviously principal cannot provide facilities unless the fees is paid
- which is depicted in this diagram and parents are not ready to pay the fees until facilities are enhanced in the school.
- So, here we end up in a deadlock situation and there's not much we can do for the school. In the previous example, we saw a
- deadlock between only two processes, namely school and parents. But a real operating system deadlock can be complex, and it usually involves
- multiple processes and resources. So, now we are going to study four necessary conditions for a deadlock to
- happen. So, they are mutual exclusion, hold and wait, no preemption, and circular wait. Let's see them all one by
- one. So, let's understand mutual exclusion. If some resources are non-shareable, which means that only a single process
- can use it. For example, here process one can use resource one, and no other process can use resource one. If this is not the case, then process cannot be
- stopped from using the resource when they require it. For example, full-screen processes in our computer cannot be used by two apps
- simultaneously. So, let's understand hold and wait now. If a process holds some resource and waits for some other resource, then the
- hold and wait is occurred. If this is not the case, then the cycle of deadlock, which we saw in the first diagram, will not get completed, and no
- deadlock will occur. The above school example is a classic example of hold and wait. As the school holds the facilities,
- and parents hold the resources. School needs the resources, and parent need the facilities. Hence, creating a hold and wait
- situation. Now, let's understand the third condition of no preemption. A resource cannot be taken from a
- process unless the process releases the resource. If preemption was allowed, deadlock would never occur because then there
- would have been no process able to hold a resource for long amount of time. For example, if your speaker is running an audio and after some time you click
- on some another audio, it starts playing it. But in case if no preemption was allowed, we would have to wait for the first audio to end. It was on an
- infinite loop. We will end up in a deadlock. So, let's understand the last condition, circular wait.
- A set of processes are waiting for each other in a circular form, then circular wait happens. For example, if you extend the first
- example to multiple processes and resources waiting for each other's held resources in a circular fashion, we will end up in
- a circular wait condition. So, hope you understood the concept of deadlock in operating system. Please don't forget to subscribe to the GeeksforGeeks YouTube
- channel and click on the bell icon.
Zum Nachlesen
Deadlock (Informatik)Deadlock oder Verklemmung bezeichnet in der Informatik einen Zustand, bei dem eine zyklische Wartesituation zwischen mehreren Prozessen auftritt, …
Betriebsmittel (Informatik)Bei wechselseitiger Abhängigkeit von Ressourcen führt ein Versagen der Zugriffsregelung zu einer sogenannten Verklemmung (deadlock). Manche Ressourcen wie z …
DeadlockEin Deadlock in der Informatik bezeichnet eine ausweglose Situation, bei dem sich mehrere Prozesse blockieren, weil sie gegenseitig aufeinander warten. Ein …
PhilosophenproblemBeim Philosophenproblem (englisch dining philosophers problem) handelt es sich um ein Fallbeispiel aus dem Bereich der theoretischen Informatik.