PowerPoint Presentation

Published on Slideshow
Static slideshow
Download PDF version
Download PDF version
Embed video
Share video
Ask about this video

Scene 1 (0s)

PRINCIPLES OF OPERATING SYSTEM CSOP1207.

Scene 2 (27s)

[Audio] In this chapter, we will be going over some key concepts regarding deadlocks. We will start by looking at the definition of deadlocks and its characterization. We will then discuss resource allocation graphs and different methods for handling deadlocks. We will then focus on deadlock avoidance, looking specifically into the Bankers Algorithm. We will then move onto deadlock detection and how to recover from deadlocks..

Scene 3 (57s)

[Audio] Deadlock is a critical issue in operating systems, where two or more processes are blocked and unable to proceed because they hold mutually exclusive sets of resources. This is caused when each process holds a resource and is also waiting for a resource held by another process, meaning none of the processes can move forward. To prevent deadlock, strategies such as prevention, avoidance, and recovery must be applied. Understanding and managing deadlock is thus an important focus in operating systems..

Scene 4 (1m 30s)

[Audio] Deadlocks can arise in a computer system when four conditions occur simultaneously: mutual exclusion, hold and wait, no preemption, and circular wait. Mutual exclusion dictates that a resource can only be accessed by one process at any given time. Hold and wait refers to when a process holds one resource and waits for another. No preemption means a process can not be involuntarily removed from a system. Circular wait occurs when processes form a circular chain, each one waiting for another process to release its resource..

Scene 5 (2m 9s)

[Audio] Discussing an important concept in operating systems, mutual exclusion, is what we will do. Mutual exclusion is the idea that only one process can use a specific resource at a time. When process P locks resource R in exclusive mode, no other process can gain access. This concept is essential for maintaining the stability of the operating system..

Scene 6 (2m 35s)

[Audio] Good morning everyone. In this chapter we will discuss about deadlocks. A deadlock is when a process holds some resources and waits for other resources to finish their execution. This situation is referred to as Hold and Wait. It means that a process can request more resources, even if they are already holding some. In other words, the processes that are involved in a deadlock acquire at least one resource in exclusive access mode and they wait for another resource which is already in exclusive access mode by another process. Thank you..

Scene 7 (3m 13s)

[Audio] Today we're discussing Deadlocks, and the concept of no preemption. When a process is holding some resource, it cannot be taken away from it until the process is done with it. That means resources can't be taken from a process without its permission. Instead, processes won't release the resources allotted to them until they've properly used them. That's the concept of no preemption..

Scene 8 (3m 40s)

[Audio] Good morning. In this chapter we will focus on the important concept of Deadlocks. Deadlock can be characterized by the presence of a circular wait: when processes wait for a resource held exclusively by another one in a closed chain or cycle. For example, three processes P1, P2 and P3, can present a deadlock if P1 is waiting for a resource exclusively held by P2, P2 for one exclusively held by P3 and P3 for one exclusively held by P1. In this case, they form a cycle, creating a deadlock. This is a critical situation and we must know how to identify and handle it..

Scene 9 (4m 24s)

[Audio] We will discuss the concept of Deadlocks, where two or more processes are blocked waiting for resources held by some other process. To better understand this, we can use the Resource Allocation Graph or RAG. This graph consists of a set of processes and resources present in the system, where a Request Edge is an edge extending from a process to the resource it is requesting, and an Assignment Edge is an edge extending from the resource to the process that has been allocated. To continue our discussion, let's look at the remaining details of the RAG..

Scene 10 (4m 59s)

[Audio] We will investigate the idea of deadlocks and Resource Allocation Graphs (RAGs). RAGs provide a graphical representation of how a deadlock could possibly occur when two or more tasks are waiting for resources held by each other and creates a cycle. If there is only one type of resource in the system, then a deadlock is probable. But, if there are multiple instances of each resource type, the potential for a deadlock rises. We will look further into this concept soon..

Scene 11 (5m 31s)

[Audio] In this chapter, we discuss the concept of deadlocks and how to understand the RAG - or Risk-Aware Graphs - model in relation to deadlocks. The RAG model is a practical system-level approach to deadlock prevention that establishes a formalism for reasoning about system failure events. We will explore how it works, and how it can be used to help improve system reliability..

Scene 12 (5m 56s)

[Audio] The three processes P1, P2, and P3 have formed a deadlock - a situation when each process is waiting for a resource which is held by another process, and neither can proceed without the other. P1 holds resource R2 and is requesting resource R1; P2 holds resources R1 and R2 and is requesting for R3; and P3 holds resource R3 and requesting for resource R2. All processes are in a waiting state and nothing can break the cycle, resulting in a system deadlock..

Scene 13 (6m 33s)

[Audio] The slide demonstrates the concept of deadlocks using a Resource Allocation Graph (RAG). It consists of 3 processes, P1, P2 and P3, and 4 resources, R1, R2, R3, and R4. Each resource has a varying number of instance, e.g. R1 has 1 instance while R4 has 3 instances. In this case, P1 holds resource R2 and is requesting resource R1. P2 holds resources R1 and R2 and is requesting resource R3. Meanwhile, P3 holds resource R3. Upon analysing the conditions, it can be determined that there is no deadlock present in the system. By using RAG and the different rules of deadlocks, one can come to this conclusion..

Scene 14 (7m 29s)

[Audio] We can see an example of a deadlock in this slide. When two or more processes are blocked, waiting on each other for a resource, a deadlock occurs. In this particular example, there are three processes and four resources. Resource allocation graphs (RAG) can be used to show the allocation of resources to processes, and reveal the deadlock cycle. It is useful to track resource allocation patterns that can lead to deadlock scenarios and take steps to prevent them from occurring..

Scene 15 (8m 2s)

[Audio] We will focus on Chapter 4 of our course, exploring the concept of Deadlocks. We will discuss the RAG (Resource Allocation Graph) Model and a given scenario involving four processes, P1, P2, P3, and P4, and two resources R1 and R2 with two instances each. Process P1 is holding a resource R2 and is requesting for Resource R1. Process P2 is holding Resource R1 and process P3 is holding Resource R1 and is requesting for R2. Process P4 is holding Resource R2. It appears that there is a potential for a deadlock, however, Process P2 and P4 are not requesting for any resources. This means any time they can release the resources, and, as a result, no deadlock occurs. This should help provide a better understanding of the topic..

Scene 16 (9m 2s)

[Audio] A deadlock is a situation where two or more processes are blocking each other, as each process is trying to use a resource that the other is currently using. To illustrate this and to help us identify whether a deadlock situation exists, we can use a Resource Allocation Graph. We will also examine a Resource Allocation Graph that contains a cycle, but not a deadlock..

Scene 17 (9m 26s)

[Audio] A deadlock occurs when two or more processes are blocked as each process holds resources that the others need. To avoid a deadlock, the system must decide whether the immediate allocation of resources will put the system in a safe state. A safe state is when there is a sequence of processes, allowing each one to acquire the needed resources, execute, then return the allocated resources and terminate. To prevent the occurrence of deadlocks, it is essential to maintain the system in a safe state at all times..

Scene 18 (9m 59s)

[Audio] We will be discussing the basic facts of deadlocks in operating systems. We will explore how to ensure safety in a system by avoiding deadlocks, and how this can be done by ensuring that a system will never enter an unsafe state. To gain a better understanding, let's dive in and explore the different concepts behind this important topic..

Scene 19 (10m 22s)

[Audio] Deadlocks occur when two or more processes are blocked and unable to continue running until an external factor changes. There are two types of deadlocks: safe and unsafe. Identifying the state of a deadlock is important and can be done by monitoring the system resources, such as computer memory and process files. To avoid deadlocks, several strategies can be employed, including preemption, detection and recovery. Other strategies used to handle deadlocks include breaking the circular wait and resource ordering..

Scene 20 (10m 58s)

[Audio] This chapter examines three different approaches to handle Deadlocks: Deadlock Prevention, Deadlock Avoidance, and Deadlock Detection. Deadlock Prevention sets certain rules that all processes must follow during execution to avoid any possibility of a deadlock. Deadlock Avoidance avoids conditions that can cause a deadlock by having processes request resources in a particular order and then releasing them in reverse. Deadlock Detection has the system regularly inspect for any existing deadlocks, if detected the system determines which process to terminate to enable other processes to carry on. We will now delve into the specifics of each approach..

Scene 21 (11m 41s)

[Audio] We are going to discuss the various methods for handling deadlocks. Deadlocks occur when four conditions hold simultaneously in a system - Mutual Exclusion, Hold and Wait, No Preemption and Circular Wait. We can make any of these conditions false to prevent deadlocks. Mutual Exclusion means only one process can control a resource at any given time, Hold and Wait requires a process to hold at least one resource before it can request another, No Preemption means a resource can only be released voluntarily by the process holds it, and Circular Wait means there must be a circular chain of two or more processes waiting for resources that are held by other processes in the chain. After discussing the conditions, we will look at how they can be prevented..

Scene 22 (12m 28s)

[Audio] Deadlock avoidance is a method of detecting and preventing a process from entering a state that may result in deadlocks. When a process requests for a resource, the entire system is analyzed to determine if it is in a safe or an unsafe state. If it is in a safe state, the resource is allocated, but if it is in an unsafe state, it is not..

Scene 23 (12m 50s)

[Audio] The Banker’s Algorithm is an algorithm designed to manage resource allocation in order to prevent deadlock. It demands that each process specifies its maximum resource requirement before it can be executed. A process is only granted permission to execute if it falls within the system’s capacity of resources. By employing the Banker’s Algorithm, it can be determined whether a process’s request for allocation of resources can be granted safely, or if it must be deferred..

Scene 24 (13m 21s)

Chapter 4 Deadlocks Banker’s Algorithm Consider the following table of a system:.

Scene 25 (13m 28s)

[Audio] The Banker's Algorithm is an algorithm used to detect deadlocks and ensure the system is in a safe state. It achieves this by comparing the process' needs with the available resources and, if the available resources can accommodate the process' needs, then the process' allocated resources are added to the available resources. This process is repeated until all process needs are met, resulting in the system being in a safe state..

Scene 26 (14m 31s)

[Audio] Our fourth chapter focuses on Deadlocks. Deadlock Detection involves allowing deadlocks to occur and then detecting them periodically, as this reduces the amount of calculations needed to fulfill a process's request. By doing so, it eliminates the need to seek out a secure sequence for each and every request. This is more effective than deadlock avoidance. After deadlocks are identified, the system employs a recovery method to solve the problem..

Scene 27 (15m 2s)

Chapter 4 Deadlocks Thank You.