Deadlocks. System Model
|
|
- Florence Bonnie Morrison
- 6 years ago
- Views:
Transcription
1 Deadlocks System Model Several processes competing for resources. A process may wait for resources. If another waiting process holds resources, possible deadlock. NB: this is a process-coordination problem much like the Critical Section problem, but at a somewhat higher level (e.g. semaphores are already assumed to exist). Finite number of resources distributed among a number of processes. Resources partitioned into types (CPU cycles, memory, files,... ). All resources within a partition are equivalent. A process must request a resource before using it. A process must release a resource when it is done with it. A process may request as many resources as it wants (can t exceed total number of resources). CS Basic OS 1 CS Basic OS 2 Sequence of Resource Usage Example Deadlock 1. Request If the request cannot immediately be granted, process must wait. 2. Use The process can hold the resource for as long as it needs. 3. Release 3 processes, 3 tape drives. Each process has requested and holds a tape drive. Each process requests another tape drive. Request/release are usually system calls. Usually, use of resource is only through system calls too. CS Basic OS 3 CS Basic OS 4
2 The 4 Necessary Conditions For Deadlock Resource Allocation Graphs Mutual Exclusion: At least one resource is non-sharable. i.e., only one process at a time can use it. If another process requests the resource, it must wait. Hold and Wait: There must exist a process that is holding at least one resource and is waiting to acquire additional resources held by other processes. No Preemption: Resources cannot be taken away from processes. the processes must voluntarily relinquish them when done. Circular Wait: There must exist a set of processes {p 0,p 1,..., p n } such that p 0 is waiting for a resource p 1 has, p 1 is waiting for p 2,...,p n is waiting for p 0. All four of these conditions must exist for there to be a deadlock. G =(V, E). V is a set of vertices and E a set of edges. Two types of vertices: 1. process nodes, p P = {p 1,p 2,..., p n }: set of all processes in the system 2. resource nodes, r R = {r 1,r 2,..., r n }: set of all resource types in the system Each edge in E is an ordered pair, either: from a process to a resource node: (p i,r j ): p i has requested and is waiting for a resource of type r j (A request edge) from a resource to a process node: (r j,p i ):a resource of type r j has been allocated to process p i (An assignment edge) Pictorially: represent each process as a circle and each resource type as a box filled with a number of dots corresponding to the number of resources of the type. CS Basic OS 5 CS Basic OS 6 Resource Allocation Graphs Sample Resource Allocation Graph r3 A request edge points to the box, an assignment edge originates from one of the dots in the box. New resource requests add request edges. Granting resources transforms request edges to assignment edges. p1 p2 p3 r4 P = {p 1,p 2,p 3 } R = {r 1,r 2,r 3,r 4 } E = {(p 1,r 1 ), (p 2,r 3 ), (r 1,p 2 ), (r 2,p 2 ), (r 2,p 1 ), (r 3,p 3 )} Process p 1 holds: 1 r 2, wants: 1 r 1. Process p 2 holds: 1 r 1, 1 r 2 ; wants: 1 r 3. Process p 3 holds: 1 r 3. No process holds or wants any r 4. CS Basic OS 7 CS Basic OS 8
3 Resource Allocation Graphs Resource Allocation Graph With a Deadlock If the graph contains no cycles, then no deadlock exists If the graph contains a cycle, a deadlock might exist. (necessary but not sufficient case for deadlock) If each resource type has exactly one instance, then a cycle is both necessary and sufficient for a deadlock r3 p1 p2 p3 r4 Two cycles: p 1 r 1 p 2 r 3 p 3 r 2 p 1. p 2 r 3 p 3 r 2 p 2. CS Basic OS 9 CS Basic OS 10 Graph With Cycle But No Deadlock How to Deal With Deadlocks p1 p2 p3 1. Never allow one to happen (deadlock prevention, deadlock avoidance). 2. Allow deadlocks then recover (deadlock detection, deadlock recovery). p4 Cycle: p 1 r 1 p 3 r 2 p 1 p 4 may release an r 2, thus making it available for p 3, and breaking the cycle. Therefore, no deadlock. CS Basic OS 11 CS Basic OS 12
4 Deadlock Prevention: Deny One of the Necessary Conditions Deadlock Avoidance Mutual Exclusion: Sharable resources do not require mutual exclusion. For example, read-only files. Some resources, however, are intrinsically non-sharable. Hold and Wait: Don t allow resources to be held when new resources are requested. Request all resources when execution begins. Request some resources and use them, but release them before asking for others. Both lead to low resource utilization and possible starvation. No Preemption: Allow preemption. Good for resources whose state can be saved and restored later, like the processor or memory. Circular Wait: Impose a total ordering on all resources. must acquire resources in increasing order. Attempt to address low resource utilization of deadlock prevention. Requires additional information about how resources are to be requested. Not all requests have to wait, but some do. Therefore, resource utilization may still be low. CS Basic OS 13 CS Basic OS 14 Simplest Avoidance Model Safe and Unsafe States (Formally) Each process must declare the maximum number of each type of resource it wants. Given this, you can construct an algorithm that guarantees a deadlock will never occur. Deadlock avoidance algorithms dynamically examine resource allocation state to ensure that there can never be a circular wait condition. A resource allocation state is defined by number of available and allocated resources and the maximum demands of the processes. A particular state is safe is the system can allocate resources to each process in some order and still avoid a deadlock. A system is in a safe state only if there exists a safe sequence. A sequence of processes <p 1,p 2,..., p n > is a safe sequence for the current allocation state if for each p i, the resources that p i can still request can be satisfied by the currently available resources plus the resources held by all the p j where j < i. E.g., if not all the resources p i needs are available, then p i could: 1. wait until all p j have finished, 2. obtain its needed resources, 3. complete its designated task, 4. return its allocated resources, and 5. terminate. When p i finishes, p i+1 can obtain its needed resources, etc. If no safe sequence exists, the system is in an unsafe state. CS Basic OS 15 CS Basic OS 16
5 Safe and Unsafe States An Example A safe state is not a deadlocked state. A deadlocked state is not a safe state. Not all unsafe states are deadlock states. However, an unsafe state may lead to a deadlock. As long as the state is safe, the os can avoid unsafe states and deadlocks. 12 resources (tape drives) in system. Maximum Needs Current (time = T 0 ) p p p Therefore, 3 free tape drives. deadlock unsafe <p 1,p 0,p 2 > is a safe sequence. If p 2 is allocated another, the system is no longer in a safe state. Why not? safe CS Basic OS 17 CS Basic OS 18 Banker s Algorithm for Deadlock Avoidance Banker s Algorithm Assume n processes and m resource types Available: array of length m = number of available resources of each type. Max: n m array = maximum demand of each process. Allocation: n m array = Current Resource Allocation. Need: n m array = remaining resource need of each process. Note that Need[i, j] =Max[i, j] Allocation[i, j] Other notation: If X and Y are vectors of length n, x<yif for each i, x[i] <y[i]. Each row of Allocation and Need is a vector. Allocation i denotes resources currenly allocated to process p i. Need i denotes resources needed by process p i. Let Request i be the request vector for process p i. If Request i [j] =k, then process p i wants k instances of resource type r j. When a request for resources is made by process p i, the following actions are taken: 1. If Request i Need i proceed to step 2. Otherwise raise an error, because a process has exceeded its maximum claim. 2. If Request i Available proceed to step 3. Otherwise p i must wait. 3. Pretend to allocate the requested resources to process p i by pretending to modify the state as follows: Available = Available Request i Allocation i = Allocation i + Request i Need i = Need i Request i If the resulting allocation is safe, let it happen for real. If it is unsafe, p i must wait. CS Basic OS 19 CS Basic OS 20
6 How To Tell a Safe State An Example 1. Let W ork and F inish be vectors of length m and n respectively. Initialize W ork = Available and F inish[i] =false. 2. Find an i Such That: (a) F inish[i] =f alse (b) Need j W ork If none exists, go to step 4 3. Simulate the finish of the process from step 2: (a) W ork = W ork + Allocation i (b) F inish[i] =true (c) goto Step 2 4. If F inish[i] =true for all i, the the system is in a safe state. If not, this is an unsafe state. Note: This is an O(mn 2 ) algorithm. Five processes {p 0,p 1,p 2,p 3,p 4 } Three resource types {A, B, C} 10 A s, 5 B s, and 7 C s Time T 0 : Allocation Max Available A B C A B C A B C p p p p p Need = Max Allocation: Need ABC p p p p p CS Basic OS 21 CS Basic OS 22 Banker s Alg. Example (cont.) Banker s Alg. Example (III) This system is in a safe state. <p 1,p 3,p 4,p 2,p 0 > is a safe sequence. Now assume p 1 requests an additional A and two more C s, i.e., Request i = (1, 0, 2). 1. First check that Request i Available i 2. (1, 0, 2) (3, 3, 2)... YES 3. Pretend: Allocation Need Available A B C A B C A B C p p p p p Apply safety algorithm. 5. Find that <p 1,p 3,p 4,p 0,p 2 > is safe 6. Therefore, grant request. An unsafe request would be Request 0 = (0, 2, 0) 1. First check that Request i Available i 2. (0, 2, 0) (3, 3, 2)... YES 3. Pretend: Allocation Need Available A B C A B C A B C p p p p p Apply safety algorithm. 5. What is the result? CS Basic OS 23 CS Basic OS 24
7 Things are Simpler With One Instance of Each Resource Claim Edge Example Add claim edges to resource allocation graphs. Claim edge (p i,r j ) indicates p i may request r j sometime in the future (use a dashed line arrow). When the request is actually made, the claim edge is converted to a request edge. When the resource is released, the assignment edge is converted back to a claim edge. Like Banker s Alg. all resources must be claimed a priori. A resource request can be granted if converting the request edge to an assignment edge does not form a cycle. Cycle detection is O(n 2 ). Banker s Alg. was O(mn 2 ). No cycle = safe state, cycle = unsafe state. p1 p 1 holds r 1. p 2 has requested r 1. Both processes have claims on r 2. Suppose p 2 requests r 2. Although r 2 is free, granting it would create a cycle which leaves the system in an unsafe state. p2 CS Basic OS 25 CS Basic OS 26 Claim Edge Example (cont.) Deadlock Detection/Recovery p1 p2 If p 1 requests r 2 a deadlock will occur. If you do not use either deadlock prevention or deadlock avoidance then deadlocks may occur. You then need algorithms to: determine when a deadlock has occurred, and recover from a deadlock. Note that the expense of deadlock detection/recovery techniques not only include the costs of maintaining the necessary information, but also the potential losses from recovery. CS Basic OS 27 CS Basic OS 28
8 Deadlock Detection (Several Instances of a Resource Type) Shoshani and Coffman Algorithm Keep the following data structures (similar to Banker s Algorithm): Available: A vector of length m indicating the number of available resources of each type. Allocation: An n m matrix defining the number of resources of each type held by each process. Request: An n m matrix indicating the current request of each process. If Request[i, j] =k, the process p i is requesting k more instances of resource type r j. Simply investigate every possible allocation sequence for the processes that remain to be completed: 1. Let W ork and F inish be vectors of length m and n, respectively. Initialize W ork = Available. For i =1, 2,..., n, if Allocation i 0then F inish[i] =f alse; else, F inish[i] =true. 2. Find an index i Such That: (a) F inish[i] =false, and (b) Request i W ork If none exists goto Step 4 3. Simulate process finish: W ork = W ork + Allocation i F inish[i] =true goto step 2 4. If F inish[i] =false for any i, the system is in a deadlocked state. Process p i is one of the deadlocked processes. CS Basic OS 29 CS Basic OS 30 An Example Allocation Request Available A B C A B C A B C p p p p p This is not deadlocked. <p 0,p 2,p 3,p 1,p 4 > results in F inish[i] = true for all i Single Instance of Each Resource is Simpler Like Banker s Alg. deadlock detection alg. is O(mn 2 ) For single instance case, we construct another kind of graph and run a cycle detection algorithm (O(n 2 )) If p 2 requests an additional C, modify request matrix to: Request ABC p p p p p Now, we are deadlocked. although we can reclaim resources from p 0, it won t leave enough for everybody else. Thus, p 1, p 2, p 3 and p 4 are deadlocked. CS Basic OS 31 CS Basic OS 32
9 Wait-For Graphs Wait-For graphs p5 Constructed by removing resource nodes from Resource Allocation Graphs and collapsing appropriate edges. An edge (p i,p j ) in a Wait-For Graph means p i is waiting for p j to release a resource. An edge exists only if (p i,r q ) and (r q,p j ) existed in the original resource allocation graph for some resource q. If the Wait-For Graph contains a cycle, there is a deadlock. If system maintains a Wait-For Graph, it can periodically check for cycles. r3 p1 p2 p3 p4 r5 p5 p1 p2 p3 r4 p4 CS Basic OS 33 CS Basic OS 34 Deadlock Algorithm Usage Recovery From Deadlock How often should the deadlock detection algorithm be run? Depends on: How often do we believe a deadlock occurs? How many processes will be affected by a deadlock when it happens? Remember, resources allocated to deadlocked processes sit idle. If you invoked it every request, then you can determine which process caused a deadlock. This is expensive. Usually only run it at long intervals, or when CPU utilization is low. Tell the operator and let him or her deal with it. Let the system recover automatically. Kill some processes involved in a circular wait. Preempt some resources. CS Basic OS 35 CS Basic OS 36
10 Process Termination Resource Preemption Kill all deadlocked processes. Expensive. Overkill (if you ll pardon the pun) Kill one process at a time until the deadlock is eliminated. Still expensive. Have to run detection alg. after every kill. Hard to make good choice of victim process. Low priority. How long it has been working already. How many resources it s holding. etc. You must reset the state of any resources in use when you kill a process. Select a victim: similar to previous. Rollback: if you preempt a resource, what do you do with the process? Roll it back to a safe state. Need to keep checkpoints or roll back to the beginning. Starvation: if you keep preempting from the same process, starvation may occur. CS Basic OS 37 CS Basic OS 38 Combined Approach to Deadlock Handling This page intentionally left blank. Usually, prevention, avoidance or detection each work better for some classes of resources than for others. Break resources into classes and use a different technique on each class. CS Basic OS 39 CS Basic OS 40
11 This page intentionally left blank. This page intentionally left blank. CS Basic OS 41 CS Basic OS 42
Chapter 7: Deadlocks
Chapter 7: Deadlocks Chapter 7: Deadlocks 7.1 System Model 7.2 Deadlock Characterization 7.3 Methods for Handling Deadlocks 7.4 Deadlock Prevention 7.5 Deadlock Avoidance 7.6 Deadlock Detection 7.7 Recovery
More informationChapter 7: Deadlocks
Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Chapter
More informationThe Deadlock Problem
The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example System has 2 disk drives. P 1 and P 2 each hold one
More informationCS307 Operating Systems Deadlocks
CS307 Deadlocks Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2016 Bridge Crossing Example Traffic only in one direction Each section of a bridge can be viewed
More informationChapter 7: Deadlocks. Operating System Concepts 9 th Edition
Chapter 7: Deadlocks Silberschatz, Galvin and Gagne 2013 Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationDeadlocks. Bridge Crossing Example. The Problem of Deadlock. Deadlock Characterization. Resource-Allocation Graph. System Model
CS07 Bridge Crossing Example Deadlocks Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2016 Traffic only in one direction Each section of a bridge can be viewed
More informationChapter 7: Deadlocks
Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock
More informationChapter 8: Deadlocks
Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock
More informationChapter 8: Deadlocks. The Deadlock Problem. System Model. Bridge Crossing Example. Resource-Allocation Graph. Deadlock Characterization
Chapter 8: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined
More informationOperating systems. Lecture 5. Deadlock: System Model. Deadlock: System Model. Process synchronization Deadlocks. Deadlock: System Model
Lecture 5 Operating systems Process synchronization Deadlocks Deadlock: System Model Computer system: Processes (program in execution); Resources (CPU, memory space, files, I/O devices, on so on). Deadlock:
More informationModule 7: Deadlocks. The Deadlock Problem. Bridge Crossing Example. System Model
Module 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined
More informationChapter 7 : 7: Deadlocks Silberschatz, Galvin and Gagne 2009 Operating System Concepts 8th Edition, Chapter 7: Deadlocks
Chapter 7: Deadlocks, Silberschatz, Galvin and Gagne 2009 Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance
More informationChapter 7: Deadlocks. Operating System Concepts 8 th Edition,
Chapter 7: Deadlocks, Silberschatz, Galvin and Gagne 2009 Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance
More informationModule 7: Deadlocks. The Deadlock Problem
Module 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock
More informationUNIT-5 Q1. What is deadlock problem? Explain the system model of deadlock.
UNIT-5 Q1. What is deadlock problem? Explain the system model of deadlock. The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another process
More informationChapter 7: Deadlocks. Operating System Concepts 8 th Edition,! Silberschatz, Galvin and Gagne 2009!
Chapter 7: Deadlocks Operating System Concepts 8 th Edition,! Silberschatz, Galvin and Gagne 2009! Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling
More informationChapter 7: Deadlocks. Operating System Concepts 8 th Edition,
Chapter 7: Deadlocks, Silberschatz, Galvin and Gagne 2009 Chapter Objectives To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks To present a number
More informationBridge Crossing Example
CSCI 4401 Principles of Operating Systems I Deadlocks Vassil Roussev vassil@cs.uno.edu Bridge Crossing Example 2 Traffic only in one direction. Each section of a bridge can be viewed as a resource. If
More informationCOP 4610: Introduction to Operating Systems (Spring 2016) Chapter 7 Deadlocks. Zhi Wang Florida State University
COP 4610: Introduction to Operating Systems (Spring 2016) Chapter 7 Deadlocks Zhi Wang Florida State University Contents Deadlock problem System model Handling deadlocks deadlock prevention deadlock avoidance
More informationCSC 539: Operating Systems Structure and Design. Spring 2005
CSC 539: Operating Systems Structure and Design Spring 2005 Process deadlock deadlock prevention deadlock avoidance deadlock detection recovery from deadlock 1 Process deadlock in general, can partition
More informationCSE Opera+ng System Principles
CSE 30341 Opera+ng System Principles Deadlocks Overview System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock
More informationSilberschatz, Galvin and Gagne 2013! CPU cycles, memory space, I/O devices! " Silberschatz, Galvin and Gagne 2013!
Chapter 7: Deadlocks Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock 7.2 Chapter
More informationModule 7: Deadlocks. System Model. Deadlock Characterization. Methods for Handling Deadlocks. Deadlock Prevention. Deadlock Avoidance
Module 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock
More informationChapter 7: Deadlocks. Chapter 7: Deadlocks. The Deadlock Problem. Chapter Objectives. System Model. Bridge Crossing Example
Silberschatz, Galvin and Gagne 2009 Chapter 7: Deadlocks Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance
More informationSystem Model. Types of resources Reusable Resources Consumable Resources
Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock System Model Types
More informationChapter 8: Deadlocks. The Deadlock Problem
Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock
More informationChapter 7: Deadlocks
Chapter 7: Deadlocks Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from
More informationChapter 7: Deadlocks. Operating System Concepts with Java 8 th Edition
Chapter 7: Deadlocks 7.1 Silberschatz, Galvin and Gagne 2009 Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock
More informationDeadlocks. Prepared By: Kaushik Vaghani
Deadlocks Prepared By : Kaushik Vaghani Outline System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection & Recovery The Deadlock Problem
More informationChapter 7: Deadlocks. Operating System Concepts 9th Edition DM510-14
Chapter 7: Deadlocks Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock 7.2 Chapter
More informationDeadlock Prevention. Restrain the ways request can be made. Mutual Exclusion not required for sharable resources; must hold for nonsharable resources.
Deadlock Prevention Restrain the ways request can be made. Mutual Exclusion not required for sharable resources; must hold for nonsharable resources. Hold and Wait must guarantee that whenever a process
More informationCMSC 412. Announcements
CMSC 412 Deadlock Reading Announcements Chapter 7 Midterm next Monday In class Will have a review on Wednesday Project 3 due Friday Project 4 will be posted the same day 1 1 The Deadlock Problem A set
More informationChapter 7: Deadlocks. Operating System Concepts 8th Edition, modified by Stewart Weiss
Chapter 7: Deadlocks, Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance (briefly) Deadlock Detection
More informationCS420: Operating Systems. Deadlocks & Deadlock Prevention
Deadlocks & Deadlock Prevention James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne The Deadlock Problem
More informationDeadlocks. Dr. Yingwu Zhu
Deadlocks Dr. Yingwu Zhu Deadlocks Synchronization is a live gun we can easily shoot ourselves in the foot Incorrect use of synchronization can block all processes You have likely been intuitively avoiding
More informationThe Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.
The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. System Model Deadlock Characterization Methods of handling
More informationChapter 8: Deadlocks. The Deadlock Problem
Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock
More informationThe Deadlock Problem. Chapter 8: Deadlocks. Bridge Crossing Example. System Model. Deadlock Characterization. Resource-Allocation Graph
Chapter 8: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined
More informationChapter 7: Deadlocks. Operating System Concepts 9 th Edition
Chapter 7: Deadlocks Silberschatz, Galvin and Gagne 2013 Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationDeadlocks. Operating System Concepts - 7 th Edition, Feb 14, 2005
Deadlocks Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock 7.2 Silberschatz,
More informationLecture 7 Deadlocks (chapter 7)
Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 7 Deadlocks (chapter 7) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The slides here are
More informationDeadlocks. Deadlock Overview
Deadlocks Gordon College Stephen Brinton Deadlock Overview The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationChapter 7: Deadlocks. Operating System Concepts 9 th Edition! Silberschatz, Galvin and Gagne 2013!
Chapter 7: Deadlocks Silberschatz, Galvin and Gagne 2013! Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationCS307: Operating Systems
CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn
More informationChapter 8: Deadlocks. Operating System Concepts with Java
Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock
More informationThe Deadlock Problem. A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.
Deadlock The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set Example semaphores A and B, initialized to 1 P 0 P
More informationDeadlock. Concepts to discuss. A System Model. Deadlock Characterization. Deadlock: Dining-Philosophers Example. Deadlock: Bridge Crossing Example
Concepts to discuss Deadlock CSCI 315 Operating Systems Design Department of Computer Science Deadlock Livelock Spinlock vs. Blocking Notice: The slides for this lecture have been largely based on those
More informationDeadlock. Chapter Objectives
Deadlock This chapter will discuss the following concepts: The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationDeadlock Risk Management
Lecture 5: Deadlocks, Deadlock Risk Management Contents The Concept of Deadlock Resource Allocation Graph Approaches to Handling Deadlocks Deadlock Avoidance Deadlock Detection Recovery from Deadlock AE3B33OSD
More informationOPERATING SYSTEMS. Prescribed Text Book. Operating System Principles, Seventh Edition. Abraham Silberschatz, Peter Baer Galvin and Greg Gagne
OPERATING SYSTEMS Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne 1 DEADLOCKS In a multi programming environment, several processes
More informationPrinciples of Operating Systems
Principles of Operating Systems Lecture 11 - Deadlocks Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian, and course
More informationICS Principles of Operating Systems. Lectures Set 5- Deadlocks Prof. Nalini Venkatasubramanian
ICS 143 - Principles of Operating Systems Lectures Set 5- Deadlocks Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Outline System Model Deadlock Characterization Methods for handling deadlocks Deadlock
More informationDeadlocks. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.
Deadlocks Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Topics Covered System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention
More informationUniversity of Babylon / College of Information Technology / Network Department. Operating System / Dr. Mahdi S. Almhanna & Dr. Rafah M.
Chapter 6 Methods for Handling Deadlocks Generally speaking, we can deal with the deadlock problem in one of three ways: We can use a protocol to prevent or avoid deadlocks, ensuring that the system will
More informationThe Deadlock Problem
Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock The Deadlock
More informationModule 6: Deadlocks. Reading: Chapter 7
Module 6: Deadlocks Reading: Chapter 7 Objective: To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks To present a number of different methods
More informationPrinciples of Operating Systems
Principles of Operating Systems Lecture 16-17 - Deadlocks Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian, and
More informationCHAPTER 7: DEADLOCKS. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.
CHAPTER 7: DEADLOCKS By I-Chen Lin Textbook: Operating System Concepts 9th Ed. Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention
More informationDeadlocks. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University
Deadlocks Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics What is deadlock? Deadlock characterization Four conditions for deadlock
More informationChapter 7: Deadlocks. Operating System Concepts 9 th Edition
Chapter 7: Deadlocks Silberschatz, Galvin and Gagne 2013 Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationThe Deadlock Problem (1)
Deadlocks The Deadlock Problem (1) A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example System has 2 disk drives. P 1 and P 2
More informationOPERATING SYSTEMS. Deadlocks
OPERATING SYSTEMS CS3502 Spring 2018 Deadlocks Chapter 7 Resource Allocation and Deallocation When a process needs resources, it will normally follow the sequence: 1. Request a number of instances of one
More informationOperating Systems 2015 Spring by Euiseong Seo DEAD LOCK
Operating Systems 2015 Spring by Euiseong Seo DEAD LOCK Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationThe Deadlock Problem
Deadlocks The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example System has 2 disk drives. P1 and P2 each
More informationCHAPTER 7 - DEADLOCKS
CHAPTER 7 - DEADLOCKS 1 OBJECTIVES To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks To present a number of different methods for preventing
More informationProcess-1 requests the tape unit, waits. In this chapter, we shall analyze deadlocks with the following assumptions:
Chapter 5 Deadlocks 5.1 Definition In a multiprogramming system, processes request resources. If those resources are being used by other processes then the process enters a waiting state. However, if other
More informationChapter 7: Deadlocks
Chapter 7: Deadlocks Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock 2009/11/30
More informationCOMP 3713 Operating Systems Slides Part 3. Jim Diamond CAR 409 Jodrey School of Computer Science Acadia University
COMP 3713 Operating Systems Slides Part 3 Jim Diamond CAR 409 Jodrey School of Computer Science Acadia University Acknowledgements These slides borrow from those prepared for Operating System Concepts
More informationContents. Chapter 8 Deadlocks
Contents * All rights reserved, Tei-Wei Kuo, National Taiwan University,.. Introduction. Computer-System Structures. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization
More informationChapter 8: Deadlocks. Bridge Crossing Example. The Deadlock Problem
Chapter 8: Deadlocks Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock 8.1 Bridge Crossing Example Bridge has one
More informationDeadlocks. Mehdi Kargahi School of ECE University of Tehran Spring 2008
Deadlocks Mehdi Kargahi School of ECE University of Tehran Spring 2008 What is a Deadlock Processes use resources in the following sequence: Request Use Release A number of processes may participate in
More informationRoadmap. Deadlock Prevention. Deadlock Prevention (Cont.) Deadlock Detection. Exercise. Tevfik Koşar. CSE 421/521 - Operating Systems Fall 2012
CSE 421/521 - Operating Systems Fall 2012 Roadmap Lecture - XI Deadlocks - II Deadlocks Deadlock Prevention Deadlock Detection Deadlock Recovery Deadlock Avoidance Tevfik Koşar University at Buffalo October
More informationChapter 7: Deadlocks CS370 Operating Systems
Chapter 7: Deadlocks CS370 Operating Systems Objectives: Description of deadlocks, which prevent sets of concurrent processes from completing their tasks Different methods for preventing or avoiding deadlocks
More informationDeadlocks. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University
Deadlocks Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics What is the deadlock problem? Four conditions for deadlock Handling deadlock
More informationChapter 7: Deadlocks. Operating System Concepts 9 th Edition
Chapter 7: Deadlocks Silberschatz, Galvin and Gagne 2013 Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationUNIT-3 DEADLOCKS DEADLOCKS
UNIT-3 DEADLOCKS Deadlocks: System Model - Deadlock Characterization - Methods for Handling Deadlocks - Deadlock Prevention. Deadlock Avoidance - Deadlock Detection - Recovery from Deadlock DEADLOCKS Definition:
More informationSystem Model. Deadlocks. Deadlocks. For example: Semaphores. Four Conditions for Deadlock. Resource Allocation Graph
System Model Deadlocks There are non-shared computer resources Maybe more than one instance Printers, Semaphores, Tape drives, CPU Processes need access to these resources Acquire resource If resource
More informationChapter 7: Deadlocks. Operating System Concepts 9 th Edition
Chapter 7: Deadlocks Silberschatz, Galvin and Gagne 2013 Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection
More informationOperating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy
Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference
More informationDeadlocks. The Deadlock Problem. Bridge Crossing Example. Topics
Deadlocks Topics - System Model - Deadlock characterization - Methods for handling deadlocks - Deadlock prevention,avoidance - Deadlock detection and recovery The Deadlock Problem - A set of blocked processes
More informationChapter - 4. Deadlocks Important Questions
Chapter - 4 Deadlocks Important Questions 1 1.What do you mean by Deadlocks? A process request for some resources. If the resources are not available at that time, the process enters a waiting state. The
More informationIntroduction to Deadlocks
Unit 5 Introduction to Deadlocks Structure 5.1 Introduction Objectives 5.2 System Model 5.3 Deadlock Characterization Necessary Conditions for Deadlock Resource-Allocation Graph. 5.4 Deadlock Handling
More informationChapter 8: Deadlocks. The Deadlock Problem
Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Combined Approach to Deadlock
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 1019 L14 Deadlocks Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Creating threads without using
More informationOperating Systems. Lecture 07: Resource allocation and Deadlock Management. Elvis C. Foster
Operating Systems Lecture 7: Resource allocation and Deadlock Management Lecture 3 started the discussion of process management, with the emphasis on CPU scheduling. This lecture continues that discussion
More informationRoadmap. Safe State. Deadlock Avoidance. Basic Facts. Safe, Unsafe, Deadlock State. Tevfik Koşar. CSC Operating Systems Spring 2007
CSC 4103 - Operating Systems Spring 2007 Roadmap Lecture - IX Deadlocks - II Deadlocks Deadlock Avoidance Deadlock Detection Recovery from Deadlock Tevfik Koşar Louisiana State University February 15 th,
More informationTDDB68 + TDDD82. Lecture: Deadlocks
TDDB68 + TDDD82 Lecture: Deadlocks Mikael Asplund, Senior Lecturer Real-time Systems Laboratory Department of Computer and Information Science Thanks to Simin Nadjm-Tehrani and Christoph Kessler for much
More informationChapter 6 Concurrency: Deadlock and Starvation
Operating Systems: Internals and Design Principles Chapter 6 Concurrency: Deadlock and Starvation Seventh Edition By William Stallings Edited by Rana Forsati CSE410 Outline Principles of deadlock Deadlock
More informationPart II Process M anagement Management Chapter 7: Deadlocks Fall 2010
Part II Process Management Chapter 7: Deadlocks Fall 2010 1 System Model System resources are utilized in the following way: Request: If a process makes a request to use a system resource which cannot
More informationOperating System: Chap7 Deadlocks. National Tsing-Hua University 2016, Fall Semester
Operating System: Chap7 Deadlocks National Tsing-Hua University 2016, Fall Semester Overview System Model Deadlock Characterization Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from
More informationFinal Exam Review. CPSC 457, Spring 2016 June 29-30, M. Reza Zakerinasab Department of Computer Science, University of Calgary
Final Exam Review CPSC 457, Spring 2016 June 29-30, 2015 M. Reza Zakerinasab Department of Computer Science, University of Calgary Final Exam Components Final Exam: Monday July 4, 2016 @ 8 am in ICT 121
More informationUnit-03 Deadlock and Memory Management Unit-03/Lecture-01
1 Unit-03 Deadlock and Memory Management Unit-03/Lecture-01 The Deadlock Problem 1. A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.
More informationChapter 7: Deadlocks. Chapter 7: Deadlocks. Deadlock Example. Chapter Objectives
Chapter 7: Deadlocks Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Silberschatz,
More informationLast Class: Synchronization Problems!
Last Class: Synchronization Problems! Reader Writer Multiple readers, single writer In practice, use read-write locks Dining Philosophers Need to hold multiple resources to perform task Lecture 11, page
More informationChapter 7: Deadlocks. Chapter 7: Deadlocks. System Model. Chapter Objectives
Chapter 7: Deadlocks Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock Silberschatz,
More informationVI. Deadlocks. What is a Deadlock? Intended Schedule. Deadlock Problem (1) ???
Intended Schedule VI. Deadlocks Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment 2 04.05.
More informationVI. Deadlocks Operating Systems Prof. Dr. Marc H. Scholl DBIS U KN Summer Term
VI. Deadlocks 1 Intended Schedule Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment 2 04.05.
More informationOutlook. Deadlock Characterization Deadlock Prevention Deadlock Avoidance
Deadlocks Outlook Deadlock Characterization Deadlock Prevention Deadlock Avoidance Deadlock Detection and Recovery e 2 Deadlock Characterization 3 Motivation System owns many resources of the types Memory,
More informationDeadlock Risk Management
Lecture 6: Deadlocks, Deadlock Risk Management Readers and Writers with Readers Priority Shared data semaphore wrt, readcountmutex; int readcount Initialization wrt = 1; readcountmutex = 1; readcount =
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 17 Deadlock Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Claim edge may request- request
More information