Deadlocks. Deadlock handling Deadlock prevention Deadlock avoidance Deadlock detection Deadlock recovery.

Slides:



Advertisements
Similar presentations
Chapter 7: Deadlocks.
Advertisements

1 Concurrency: Deadlock and Starvation Chapter 6.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
1 Concurrency: Deadlock and Starvation Chapter 6.
Deadlock Prevention, Avoidance, and Detection
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Deadlock Prevention, Avoidance, and Detection.  The Deadlock problem The Deadlock problem  Conditions for deadlocks Conditions for deadlocks  Graph-theoretic.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Chapter 81 Deadlock is:  A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.  Example.
1 Wednesday, June 28, 2006 Command, n.: Statement presented by a human and accepted by a computer in such a manner as to make the human feel that he is.
Chapter 7: Deadlocks. 7.2 Chapter Objectives To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks.
Deadlock CSCI 444/544 Operating Systems Fall 2008.
1 Lecture 8: Deadlocks Operating System Spring 2008.
1 M. Bozyigit ICS Operating Systems Deadlock. 2 Deadlock n Permanent blocking of a set of processes that either compete for system resources or communicate.
Witawas Srisa-an Chapter 6
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
1 Concurrency: Deadlock and Starvation Chapter 6.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 7: Deadlocks.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Bridge Crossing Example Traffic only in one direction. Each section.
Deadlock Characterization
Concurrency: Deadlock and Starvation Chapter 6. Goal and approach Deadlock and starvation Underlying principles Solutions? –Prevention –Detection –Avoidance.
1 Concurrency: Deadlock and Starvation Chapter 6.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Deadlocks.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
CS6502 Operating Systems - Dr. J. Garrido Deadlock – Part 2 (Lecture 7a) CS5002 Operating Systems Dr. Jose M. Garrido.
Chapter 6 Concurrency: Deadlock and Starvation
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks System Model Deadlock Characterization Methods.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings.
Chapter 8 Deadlocks. Objective System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 6 Deadlocks Slide 1 Chapter 6 Deadlocks.
Informationsteknologi Monday, October 1, 2007Computer Systems/Operating Systems - Class 111 Today’s class Deadlock.
DEADLOCKS Prepared By: Dr. Vipul Vekariya. D EADLOCK A set of processes is deadlocked when each process in the set is blocked awaiting an event that can.
Lecture 6 Deadlock 1. Deadlock and Starvation Let S and Q be two semaphores initialized to 1 P 0 P 1 wait (S); wait (Q); wait (Q); wait (S);. signal (S);
Chapter 7: Deadlocks.
OPERATING SYSTEM CONCEPTS AND PRACTISE
Chapter 7: Deadlocks.
ITEC 202 Operating Systems
G.Anuradha Ref:- Galvin
Chapter 7: Deadlocks Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Chapter 7: Deadlocks.
Advanced Operating System Fall 2009
Chapter 7 Deadlock.
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Chapter 7 Deadlocks.
Process Deadlocks.
Chapter 7: Deadlocks.
Deadlocks Definition A set of processes is in a Deadlock state when every process in the set is waiting for an event that can only be caused by another.
Chapter 3 Deadlocks 3.1. Resource 3.2. Introduction to deadlocks
Deadlock B.Ramamurthy CSE421 1/11/2019 B.Ramamurthy.
G.Anuradha Ref:- Galvin
Chapter 7: Deadlocks.
Deadlocks Peng Lu In a multiprogramming environment, several processes may compete for a finite number of resources. A process requests resources; if the.
Deadlock B.Ramamurthy CSE421 2/23/2019 B.Ramamurthy.
Deadlocks Session - 13.
DEADLOCK.
Chapter 7: Deadlocks.
Lecture 19: Deadlock: Conditions, Detection and Avoidance
Deadlock B.Ramamurthy CSE421 4/23/2019 B.Ramamurthy.
Deadlock B.Ramamurthy CSE421 5/1/2019 B.Ramamurthy.
CSCI 315 Operating Systems Design
Chapter 7: Deadlocks.
Chapter 8: Deadlocks Deadlock Characterization
Deadlock B.Ramamurthy CSE421 8/28/2019 B.Ramamurthy.
Deadlock B.Ramamurthy CSE421 9/3/2019 B.Ramamurthy.
Presentation transcript:

Deadlocks

Deadlock handling Deadlock prevention Deadlock avoidance Deadlock detection Deadlock recovery

How deadlocks arise Conflicting need for resource by two or more processes All process are unable to proceed

Deadlock Example Precess P Process Q Get A Get B Release B Release A Get B Get A Release B Release A

Four conditions for deadlocks Mutual exclusion of resources Hold and wait –A process can hold a resource and wait for another No preemption –A process will release resources voluntarily Circular wait –There is a circular wait among the processes

Deadlock prevention Make one of the four conditions false aways No deadlock! Which condition? Only circular wait condition is doable

Make circular wait condition false always Order all the resources Processes can request resources that are ordered strictly higher than what they are holding Can prove that there are cycles in wait for graph

Deadlock avoidance Allows more concurrency than prevention A decision is made dynamically whether the current resource allocation request will potentially lead to a deadlock (if granted) Needs knowledge of future resource needs

Two rules of deadlock avoidance Do not start a process if its demands might lead to a deadlock Do not grant an incremental resource request to a process if doing so might lead to a deadlock

Initial denial R = (R1, R2, …, Rm) set of system resources; m types of resources A = (V1, V2, …, Vm) available reources (not allocated to any process) at any time Claim matrix; maximum requirement of each process for each resource Current allocation matrix; what each process holds currently

Relations Ri = Vi + sum(A_ki) k going from 1 to n C_kl <= R_i for all k, I A_ki <= C_ki for all k, i (Strong condition): Start a new process P_n+1 only if R_I >= C_(n+1)i+sum(C_ki) k going from 1 to n; for all i

Resource allocation denial Banker’s algorithm Safe and unsafe states Detect if a state is unsafe Go from one safe state to another safe state

Deadlock recovery Forcibly terminate some processes to recover from deadlocks. Deadlock breaking set: Set of processes, which when terminated, will lead to the other processes’ normal termination. Cost of forcibly terminating a process

Deadlock recovery Cont’d Cost of deadlock breaking set: sum of the cost of aborting processes in the deadlock breaking set. Optimal deadlock breaking set: Deadlock breaking set of least cost. Finding the optimal deadlock breaking set is an NP-hard problem.