Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Similar documents
Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Chapter 7: Deadlocks. Operating System Concepts 8 th Edition,

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - XI Deadlocks - II. University at Buffalo. Deadlocks. October 6 th, 2011

Chapter 7: Deadlocks. Operating System Concepts 8 th Edition,

Chapter 7 : 7: Deadlocks Silberschatz, Galvin and Gagne 2009 Operating System Concepts 8th Edition, Chapter 7: Deadlocks

Chapter 7: Deadlocks. Operating System Concepts 8 th Edition,! Silberschatz, Galvin and Gagne 2009!

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Chapter 7: Deadlocks. Operating System Concepts with Java 8 th Edition

Chapter 7: Deadlocks. Chapter 7: Deadlocks. The Deadlock Problem. Chapter Objectives. System Model. Bridge Crossing Example

Deadlocks. Operating System Concepts - 7 th Edition, Feb 14, 2005

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Chapter 7: Deadlocks

Deadlock. Operating Systems. Autumn CS4023

Chapter 8: Deadlocks. The Deadlock Problem

Fig Bridge crossing - deadlock

CS370 Operating Systems

CS370 Operating Systems

Chapter 8: Deadlocks. Bridge Crossing Example. The Deadlock Problem

CS370 Operating Systems

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition! Silberschatz, Galvin and Gagne 2013!

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Deadlock. Concepts to discuss. A System Model. Deadlock Characterization. Deadlock: Dining-Philosophers Example. Deadlock: Bridge Crossing Example

Chapter 8: Deadlocks. Operating System Concepts with Java

More on Synchronization and Deadlock

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

OPERATING SYSTEMS. Prescribed Text Book. Operating System Principles, Seventh Edition. Abraham Silberschatz, Peter Baer Galvin and Greg Gagne

Module 7: Deadlocks. The Deadlock Problem

Module 7: Deadlocks. System Model. Deadlock Characterization. Methods for Handling Deadlocks. Deadlock Prevention. Deadlock Avoidance

CS420: Operating Systems. Deadlocks & Deadlock Prevention

Roadmap. Tevfik Ko!ar. CSC Operating Systems Spring Lecture - X Deadlocks - II. Louisiana State University. 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.

Last Class: Monitors. Real-world Examples

COMP 3713 Operating Systems Slides Part 3. Jim Diamond CAR 409 Jodrey School of Computer Science Acadia University

Deadlock. A Bit More on Synchronization. The Deadlock Problem. Deadlock Characterization. Operating Systems 2/7/2005. CSC 256/456 - Spring

Chapter 8: Deadlocks. The Deadlock Problem

The Deadlock Problem. Chapter 8: Deadlocks. Bridge Crossing Example. System Model. Deadlock Characterization. Resource-Allocation Graph

Deadlocks. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Chapter 7: Deadlocks

The Deadlock Problem

Chapter 7: Deadlocks. Chapter 7: Deadlocks. System Model. Chapter Objectives

Deadlocks. Dr. Yingwu Zhu

UNIT-3 DEADLOCKS DEADLOCKS

Chapter 7: Deadlocks. Chapter 7: Deadlocks. Deadlock Example. Chapter Objectives

Readings and References. Deadlock. Deadlock. Simple Traffic Gridlock Example. Reading. CSE Computer Systems November 30, 2001.

Chapter 7: Deadlocks CS370 Operating Systems

Lecture 7 Deadlocks (chapter 7)

Introduction to OS. Deadlock. MOS Ch. 6. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1

Deadlock. Readings and References. Simple Traffic Gridlock Example. Deadlock. Reading. Other References. CSE 410, Spring 2006 Computer Systems

Chapter 7: Deadlocks

Deadlock Prevention. Deadlock can be prevented if 1 of the 4 conditions cannot hold

Operating Systems 2015 Spring by Euiseong Seo DEAD LOCK

Chapter 7: Deadlocks. Operating System Concepts 9th Edition DM510-14

CHAPTER 7: DEADLOCKS. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

The Deadlock Problem

Deadlocks. Prepared By: Kaushik Vaghani

CS370 Operating Systems

Chapter 8: Deadlocks

Chapter 8: Deadlocks. The Deadlock Problem. System Model. Bridge Crossing Example. Resource-Allocation Graph. Deadlock Characterization

Chapter 7: Deadlocks. Operating System Concepts 8th Edition, modified by Stewart Weiss

Chapter 7: Deadlocks

Module 7: Deadlocks. The Deadlock Problem. Bridge Crossing Example. System Model

The Deadlock Problem

CMSC 412. Announcements

Deadlocks. Deadlock Overview

CSC 539: Operating Systems Structure and Design. Spring 2005

Operating System: Chap7 Deadlocks. National Tsing-Hua University 2016, Fall Semester

Silberschatz, Galvin and Gagne 2013! CPU cycles, memory space, I/O devices! " Silberschatz, Galvin and Gagne 2013!

CS307: Operating Systems

CSE 4/521 Introduction to Operating Systems. Lecture 12 Main Memory I (Background, Swapping) Summer 2018

System Model. Types of resources Reusable Resources Consumable Resources

CS370 Operating Systems

Module 6: Deadlocks. Reading: Chapter 7

Principles of Operating Systems

Deadlock Prevention. CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

Operating Systems. Lecture3.2 - Deadlock Management. Golestan University. Hossein Momeni

CSE 451: Operating Systems Winter Deadlock. Gary Kimura

Deadlock and Starvation

Process Synchronisation (contd.) Deadlock. Operating Systems. Spring CS5212

Final Exam Review. CPSC 457, Spring 2016 June 29-30, M. Reza Zakerinasab Department of Computer Science, University of Calgary

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - X Deadlocks - I. University at Buffalo. Synchronization structures

Roadmap. Problems with Semaphores. Semaphores. Monitors. Monitor - Example. Tevfik Koşar. CSE 421/521 - Operating Systems Fall 2012

CHAPTER 7 - DEADLOCKS

UNIT-5 Q1. What is deadlock problem? Explain the system model of deadlock.

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.

CSE Opera+ng System Principles

Outlook. Deadlock Characterization Deadlock Prevention Deadlock Avoidance

Potential Deadlock Example

Bridge Crossing Example

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Frequently asked questions from the previous class survey

Principles of Operating Systems

The Deadlock Problem (1)

csci 3411: Operating Systems

Chapter 6. Deadlock. (A Quick Introduction)

Checkpoints. Logs keep growing. After every failure, we d have to go back and replay the log. This can be time consuming. Checkpoint frequently

When Deadlock Happens

Comp 204: Computer Systems and Their Implementation. Lecture 9: Deadlock

Transcription:

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 Recovery from Deadlock 7.2 Silberschatz, Galvin and Gagne 2013

Chapter 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 or avoiding deadlocks in a computer system 7.3 Silberschatz, Galvin and Gagne 2013

System Model System consists of resources Resource types R 1, R 2,..., R m CPU cycles, memory space, I/O devices (printers, DVD writers, ) Each resource type R i has W i instances. Each process utilizes a resource as follows: request use release 7.4 Silberschatz, Galvin and Gagne 2013

Deadlock Characterization Deadlock can arise if four conditions hold simultaneously. Mutual exclusion: only one process at a time can use a resource Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes No preemption: a resource can be released only voluntarily by the process holding it, after that process has completed its task Circular wait: there exists a set {P 0, P 1,, P n } of waiting processes such that P 0 is waiting for a resource that is held by P 1, P 1 is waiting for a resource that is held by P 2,, P n 1 is waiting for a resource that is held by P n, and P n is waiting for a resource that is held by P 0. Notice: Circular wait implies Hold and wait implying the four conditions are not totally independent 7.5 Silberschatz, Galvin and Gagne 2013

Deadlock with Mutex Locks Where have we seen this? How does deadlock occur? 7.6 Silberschatz, Galvin and Gagne 2013

Resource-Allocation Graph Process Resource Type with 4 instances P i requests instance of R j P i P i is holding an instance of R j R j P i R j 7.7 Silberschatz, Galvin and Gagne 2013

Resource-Allocation Graph A set of vertices V and a set of edges E. V is partitioned into two types: P = {P 1, P 2,, P n }, the set consisting of all the processes in the system R = {R 1, R 2,, R m }, the set consisting of all resource types in the system E = {P 1 R 1, R 1 P 2 } request edge directed edge P i R j assignment edge directed edge R j P i What is the meaning of E? Draw the resource-allocation graph. 7.8 Silberschatz, Galvin and Gagne 2013

Example of a Resource Allocation Graph Is this an example of deadlock? Why or why not? 7.9 Silberschatz, Galvin and Gagne 2013

Deadlock or no Deadlock? Explain 7.10 Silberschatz, Galvin and Gagne 2013

Deadlock or no Deadlock? Explain 7.11 Silberschatz, Galvin and Gagne 2013

Basic Facts If graph contains no cycles no deadlock If graph contains a cycle if only one instance per resource type, then deadlock if several instances per resource type, possibility of deadlock 7.12 Silberschatz, Galvin and Gagne 2013

Methods for Handling Deadlocks Ensure that the system will never enter a deadlock state: Deadlock prevention - ensure one of the necessary conditions cannot hold Deadlock avoidence - give OS advanced info regarding resources a process will request to make an informed decision Allow the system to enter a deadlock state and then recover Ignore the problem and pretend that deadlocks never occur in the system; used by most operating systems, including UNIX 7.13 Silberschatz, Galvin and Gagne 2013