CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11:30 - 12:30 AM.

Slides:



Advertisements
Similar presentations
Chapter 7: Deadlocks.
Advertisements

Chapter 7: Deadlocks.
COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM.
1 Advanced Operating Systems - Spring 2009 Lecture 9 – February 9, 2009 Dan C. Marinescu Office: HEC 439 B. Office.
02/27/2004CSCI 315 Operating Systems Design1 Process Synchronization Deadlock Notice: The slides for this lecture have been largely based on those accompanying.
Scheduling Algorithms
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling CS 3100 CPU Scheduling1. Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various.
COT 5611 Operating Systems Design Principles Spring 2012 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 5:00-6:00 PM.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 7: Deadlocks.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks.
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.
1 Chapter 7: Deadlock. 2 The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance.
Modified from Silberschatz, Galvin and Gagne Lecture 13 Chapter 7: Deadlocks.
02/19/2008CSCI 315 Operating Systems Design1 Deadlock Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 7: Deadlocks.
Silberschatz, Galvin and Gagne  Operating System Concepts Deadlock and Starvation Deadlock – two or more processes are waiting indefinitely for.
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Example of SJF ProcessArrival TimeBurst Time P P P
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
CS 153 Design of Operating Systems Spring 2015 Lecture 11: Scheduling & Deadlock.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Deadlocks.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks.
System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention, Avoidance, and Detection Recovering from Deadlock Combined Approach.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
Cosc 4740 Chapter 6, Part 4 Deadlocks. The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held.
CHAPTER 8: DEADLOCKS System Model Deadlock Characterization
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.
This Time - Deadlock Definition Conditions for deadlocks
Review for Quiz-2 Applied Operating System Concepts Chap.s 1,2,6,7 - ECE3055b, Spring 2005.
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.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
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.
7.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 7: Deadlocks.
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);
Process Management Deadlocks.
lecture 5: CPU Scheduling
Chapter 6: CPU Scheduling
Dan C. Marinescu Office: HEC 439 B. Office hours: M, Wd 3 – 4:30 PM.
Applied Operating System Concepts -
Chapter 5: CPU Scheduling
COT 5611 Operating Systems Design Principles Spring 2014
CGS 3763 Operating Systems Concepts Spring 2013
COT 5611 Operating Systems Design Principles Spring 2014
COP 4600 Operating Systems Fall 2010
Midterm review: closed book multiple choice chapters 1 to 9
Chapter5: CPU Scheduling
COT 4600 Operating Systems Spring 2011
Chapter 5: CPU Scheduling
Deadlock B.Ramamurthy CSE421 1/11/2019 B.Ramamurthy.
CGS 3763 Operating Systems Concepts Spring 2013
COT 4600 Operating Systems Fall 2009
Chapter 6: CPU Scheduling
CGS 3763 Operating Systems Concepts Spring 2013
CGS 3763 Operating Systems Concepts Spring 2013
Deadlocks Session - 13.
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
CSE 153 Design of Operating Systems Winter 2019
CGS 3763 Operating Systems Concepts Spring 2013
EECE.4810/EECE.5730 Operating Systems
Chapter 8: Deadlocks Deadlock Characterization
Presentation transcript:

CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM

Last time:  CPU Scheduling  Process synchronization Today Answers to student questions. Process synchronization  Semaphores  Monitors  Thread coordination with a bounded buffer. Next time  Process synchronization Reading assignments  Chapter 6 of the textbook Lecture 27 – Friday, March 22, 2013 Lecture 272

March 11 th Monday: How does the CPU decide which type of scheduling to use? In what applications would the different CPU scheduling techniques be applicable? Can a system utilize any of the algorithms or is it built with a specific one? If Round Robin is the fairest scheduler, why are there other types that are used? How do you determine the length of the next CPU burst for one thread? Why is the waiting factor typically.5 to determine the length of the next CPU burst? Difference between SRTF and SJF? What is the importance of exponential averaging? Lecture 273

March 13 th Wednesday: Priority Inversion, how does a thread acquire a lock? How do locks work? How is the priorities set or determined by the scheduler? How does the computer know whether a process has a higher priority than another process? Is there an error found on the computer when starvation happens? Can a process age to have absolutely zero priority? And if it does, does it get ignored or does it get re-sent back into waiting? In Priority scheduling would SJF have precedence over RR? Lecture 274

March 15 th Friday: What methods are used for the system to determine which core to use for a specific process (since each core may finish different processes at different times, does it pre-allocate where a process will go?) What is the average maximum temperature that a processor can function in? Does a higher clock rate always indicate that a computer is inefficient? What happens if one boosts a clock rate too much? For NUMA, what happens if two processes or threads try to access the same data at the same time? What is a system contention scope? What are the drawbacks of Fair Share Scheduling? Discuss the purpose of the Light Weight Process (LWP). What is a homogeneous processor? What is a soft and hard processor affinity? Lecture 275

Contention scope Contention scope  which threads compete with one another for CPU. User level threads, many-to-one and many-to-many  Scheduled by the thread library  Process contention scope (PCS)  competition among the threads belonging to the same process Kernel-level threads  The system scheduler  System contention scope (SCS)  competition is among all threads in the system. Lecture 276

7

System model Resource types R 1, R 2,..., R m (CPU cycles, memory space, I/O devices) Each resource type R i has W i instances. Resource access model:  request  use  release Lecture 278

Wait-for-graph  directed graph (an edge connected one vertex to another has a direction associated with it). The vertices are the locks and the threads. Lecture 279

Simultaneous conditions for deadlock 1. Mutual exclusion: only one process at a time can use a resource. 2. Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes. 3. No preemption: a resource can be released only voluntarily by the process holding it (presumably after that process has finished). 4. Circular wait: there exists a set {P 0, P 1, …, P 0 } 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 0 is waiting for a resource that is held by P 0. The circular wait is reflected by a cycle in the Wait-for-Graph Lecture 2710

Lecture 2711

Semaphores Abstract data structure introduced by Dijkstra to reduce complexity of threads coordination; has two components  C  count giving the status of the contention for the resource guarded by s  L  list of threads waiting for the semaphore s Counting semaphore – for a resource with multiple copies. Supports two operations: V - signal() increments the semaphore C P - wait() P decrements the semaphore C. Binary semaphore: C is either 0 or 1. Lecture 2712

P and V counting semaphore operations The value of the semaphore S is the number of units of the resource that are currently available. The P operation forces a thread to sleep until a resource protected by the semaphore becomes available, at which time the resource is immediately claimed.  wait(): Decrements the value of semaphore variable by 1. If the value becomes negative, the process executing wait() is blocked, i.e., added to the semaphore's queue. The V operation is the inverse: it makes a resource available again after the thread has finished using it.  signal(): Increments the value of semaphore variable by 1. After the increment, if the pre-increment value was negative (meaning there are threads waiting for a resource), it transfers a blocked thread from the semaphore's waiting queue to the ready queue. Lecture 2713

The Wait (P) and Signal (V) operations P (s) (wait) { If s.C > 0 then s.C − −; else join s.L; } V (s) (signal) { If s.L is empty then s.C + +; else release a process from s.L; } Lecture 2714