Lecture 11 Deadlocks and Devices. Last Time CPSC 457 - Tyson Kendon 20161 Concurrency Some notes about Semaphores Spinlocks Classical Synchronization.

Slides:



Advertisements
Similar presentations
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Advertisements

Lecture 6 :Deadlocks. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate with each other Involves.
Operating Systems Lecture Notes Deadlocks Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
DEADLOCK. Contents  Principles of deadlock  Deadlock prevention  Deadlock detection.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Chapter 6 Concurrency: Deadlock and Starvation
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Deadlocks  (How to Detect Them and Avoid Them) A:
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
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.
Modified from Silberschatz, Galvin and Gagne Lecture 13 Chapter 7: Deadlocks.
Deadlock CSCI 444/544 Operating Systems Fall 2008.
1 Lecture 8: Deadlocks Operating System Spring 2008.
OS Spring 2004 Concurrency: Principles of Deadlock Operating Systems Spring 2004.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
OS Fall’02 Concurrency: Principles of Deadlock Operating Systems Fall 2002.
1 Concurrency: Deadlock and Starvation Chapter 6.
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Ch 7: Deadlock Dr. Mohamed Hefeeda.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Deadlocks.
SWE202 Review. Processes Process State As a process executes, it changes state – new: The process is being created – running: Instructions are being.
Operating Systems CSE 411 Kernel synchronization, deadlocks Kernel synchronization, deadlocks Dec Lecture 31 Instructor: Bhuvan Urgaonkar.
Chapter 7 – Deadlock (Pgs 283 – 306). Overview  When a set of processes is prevented from completing because each is preventing the other from accessing.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Deadlock Operating Systems: Internals and Design Principles.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 14, 2005 Chapter 7: Deadlocks The Deadlock.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 7 Operating Systems.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 6 Deadlocks Slide 1 Chapter 6 Deadlocks.
Deadlock. Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 6: Deadlocks.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 7: Deadlocks.
Introduction to operating systems What is an operating system? An operating system is a program that, from a programmer’s perspective, adds a variety of.
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 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Process Management Deadlocks.
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Operating systems Deadlocks.
Operating Systems (CS 340 D)
G.Anuradha Ref:- Galvin
CS703 - Advanced Operating Systems
Operating Systems (CS 340 D)
Advanced Operating System Fall 2009
CSCI 315 Operating Systems Design
CPSC 457 Operating Systems
Chapter 7: Deadlocks.
Operating Systems.
Module 2: Computer-System Structures
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
COMS Prelim 1 Review Session
Chapter 7: Deadlocks.
Operating systems Deadlocks.
Deadlocks Session - 13.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Lecture 27 Syed Mansoor Sarwar
Module 2: Computer-System Structures
CSE 153 Design of Operating Systems Winter 2019
Chapter 13: I/O Systems.
Chapter 8: Deadlocks Deadlock Characterization
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Lecture 11 Deadlocks and Devices

Last Time CPSC Tyson Kendon Concurrency Some notes about Semaphores Spinlocks Classical Synchronization Problems Monitors Monitor Construction Condition Variables Using Monitors Java

This Time CPSC Tyson Kendon Deadlocks Resource Allocation Detecting Deadlocks Resolving Deadlocks Devices Hosts and Controllers I/O Drivers

Deadlocks CPSC Tyson Kendon Two or more processes are unable to proceed because each is waiting for another process (which is waiting) to proceed.

System Model CPSC Tyson Kendon Processes Resources Requests Request Use Release

Deadlock Characterization CPSC Tyson Kendon Mutual Exclusion - resources cannot be shared, a second request must be delayed 2.Hold and wait - A process must be holding a resource and waiting for another resource 3.No preemption - resources cannot be taken from a process once it has them 4.Circular waiting - For a set of processes {P 1,..., P n } then P 1 must wait for P 2, which must wait for P 3 … which must wait for P n, which must wait for P 1

Resource-Allocation Graphs CPSC Tyson Kendon 20166

Handling Deadlocks CPSC Tyson Kendon 20167

Preventing Deadlocks CPSC Tyson Kendon Prevent one of the four characterizations from holding.

Avoiding Deadlocks CPSC Tyson Kendon Decide (at runtime) which situations are safe and which will lead to Deadlocks.

Detecting Deadlocks CPSC Tyson Kendon Look at our processes and resources and determine if they are deadlocked.

Recovering From Deadlocks CPSC Tyson Kendon Look at our processes and resources restore them to a point where the system is free of deadlocks.

Devices and I/O CPSC Tyson Kendon

Devices and Hardware CPSC Tyson Kendon Host the CPU / Memory and OS, ”the computer” Controller the electronics and logic that operate the device, port or bus

Working with Controllers CPSC Tyson Kendon Registers Keep registers available to pass data can control between host and controller Memory Mapped I/O Map information from/for the controller directly into virtual memory

Controlling Controllers CPSC Tyson Kendon Polling OS Loops and waits for the device to work Interrupts Device does its work and interrupts the host Direct Memory Access Device moves a lot of memory then interrupts

Drivers CPSC Tyson Kendon Interface Define how a type of device should behave Driver Write the software to conform the device to the interface the OS expects

Device Characteristics aspectvariationexample Data-transfer modeCharacter block Terminal disk Access methodSequential random Modem DVD Transfer scheduleSynchronous asynchronous Tape keyboard sharingDedicated shareable Tape keyboard CPSC Tyson Kendon

Device Characteristics (2) CPSC Tyson Kendon Device speedLatency Seek time Transfer rate Delay between ops Electronic? - memory Physical? - disk Mechanical? – tape- robot I/O directionRead-only Write-only read-write DVD Graphics controller disk

Next Time CPSC Tyson Kendon File Systems and Disks How do we organize data on secondary storage to make sense and access it quickly Devices What considerations do we have to make about the OS to work with Devices Multiprocessor Environments