We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byAntwan Gilbert
Modified about 1 year ago
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Objective: Selecting Thread to Run Scheduler selects a thread to run Processor relinquished Context Switch
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Thread States: Initial View Ready Inactive Running Thread unknown to scheduler. Thread waiting for scheduler to give it a turn.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Time-Sliced Scheduling Each thread runs for a fixed amount of time. Threads are run in a round-robin sequence. Appropriate for regular multi-programming environments. Poor response time performance. Need better strategy for real-time systems.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Pending Threads Threads must often wait for an event to occur or some shared resource to become available. Simply moving the task back to the ready state isn't appropriate because it may run again later only to discover that it must continue to wait, thus adding unnecessary task switching overhead.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Thread States: Revised View Running Pending Inactive Ready Thread waiting for an external event or shared resource. Thread waiting for scheduler to give it control.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. State of Thread A Interrupt Routine Run-Time Kernel State of Thread B Context Switch Pending Running Ready Non-Preemptive Context Switch Running Yield Call Interrupted Post Ready
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Non-Preemptive Thread States Running Inactive Ready Pending Yielding Interrupted
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. State of Thread A Interrupt Routine Run-Time Kernel State of Thread B Pending Running Ready Preemptive Context Switch Interrupted Ready Interrupted Post Context Switch
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Preemptive Thread States Running Inactive Ready Pending Interrupted
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Priority-Based Scheduling Each thread is assigned a priority number. Static priorities never change. Dynamic priorities can vary during execution. –Required to avoid Priority Inversion Problem.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Priority Inversion Resource Owned by High-Priority Thread State Run-Time Kernel Low-Priority Thread State Running Pending RunningReady Low-Priority ThreadHigh-Priority Thread Request resource Release Resource
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Priority Inversion Bounded Priority Inversion –Duration is no longer than that of the critical section where the lower-priority thread owns the resource. Unbounded Priority Inversion –Occurs when a third (medium-priority) thread preempts the low-priority thread during the inversion for an indefinite amount of time.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Mars Pathfinder Suffered Unbounded Priority Inversion Low-priority meteorological thread Acquired the (shared) bus. Medium-priority, long-running, communications thread Woke up and preempted the meteorological thread. High-priority bus management thread Woke up and was blocked because it couldn't acquire the bus; when it couldn't meet its deadline it reinitialized the computer via a hardware reset.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Limiting the Duration of an Unbounded Priority Inversion Objective: –To prevent low-priority thread from being preempted by medium-priority thread during the priority inversion. Strategies: –Priority Inheritance Protocol –Priority Ceiling Protocol Technique: –Manipulate thread priorities at run-time.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Priority Inheritance Protocol When a high-priority thread attempts to lock a mutex already locked by a lower-priority thread, the Priority Inheritance Protocol (PIP) temporarily raises the priority of the low-priority thread to match that of the blocked thread until the low- priority thread unlocks the mutex. Advantage: It is transparent to the application. Disadvantage: Adds complexity to the kernel.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Priority Ceiling Protocol Priority of the low-priority thread is raised immediately when it locks the mutex rather than waiting for a subsequent lock attempt by a higher- priority thread. Advantage: Easy to implement. Disadvantage: The priority ceiling value must be predetermined for use with the mutex; this value must be the highest among all the threads that attempt to lock the same mutex.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Assigning Priorities Scheduling: Threads with higher priority are scheduled to run first. Objective: Assign priorities in such a way that all outputs are computed before their deadlines.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Assignment Strategies Deadline-Driven Assignment –Assign highest priorities to threads with shortest deadlines. Rate Monotonic Assignment –Assign highest priorities to threads that run most frequently without regard to deadlines.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Deadlock
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Deadlock Definition: Two or more threads are blocked waiting on each other's resources. Necessary Condition: Threads require exclusive access to two or more shared resources simultaneously.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Entering Deadlock Thread T1: Mutex M1: Mutex M2: Thread T2: Pending on M2 Ready Running Locked by T1 Pending on M1RunningReady Locked by T2
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. Preventing Deadlock 1.Require all threads to acquire resources in the same order. Often locks resources longer than necessary. Occasionally there is no order that is convenient for all threads. 2.Require threads to release all resources and start over if any one resource can't be acquired.
Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Access Control Protocols.
Introduction to Embedded Systems Rabie A. Ramadan 5.
Introduction to Embedded Systems Resource Management - III Lecture 19.
0 Synchronization Problem Resource sharing –Requires mutual exclusion –Critical section A code section that should be executed mutually exclusively by.
PRIORITY INHERITANCE PROTOCOLS Will Hedgecock EECE /13/2010 Sha, L. et al. Priority Inheritance Protocols: An Approach to Real-Time Synchronization.
Introduction to Embedded Systems Rabie A. Ramadan 7.
UCDavis, ecs251 Fall /23/2007ecs251, fall Operating System Models ecs251 Fall 2007 : Operating System Models #3: Priority Inversion Dr. S.
CHAPTER 7 CONCURRENT SOFTWARE Copyright © 2000, Daniel W. Lewis. All Rights Reserved.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
CSE 522 Real-Time Scheduling (3) Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
Mutual Exclusion. Readings r Silbershatz: Chapter 6 2.
Washington WASHINGTON UNIVERSITY IN ST LOUIS Resource and Resource Access Control Fred Kuhns Applied Research Laboratory Computer Science and Engineering.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
Deadlocks Silberschatz Ch. 7 and Priority Inversion Problems.
1 Review of Process Mechanisms. 2 Scheduling: Policy and Mechanism Scheduling policy answers the question: Which process/thread, among all those ready.
Priority Inheritance and Priority Ceiling Protocols L. Sha, R. Rajkumar, and J. P. Lehoczky, "Priority Inheritance Protocols: An Approach to Real-Time.
Lecture 9 Page 1 CS 111 Online Deadlock Detection and Recovery Allow deadlocks to occur Detect them once they have happened – Preferably as soon as possible.
Real Time Scheduling. Outline About real time systems Basic Scheduling Techniques Recent Work Future Work.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
RTOS task scheduling models. Scheduling Definition: It is the method by which threads, processes or data flows are given access to system resources.
- 1 - P. Marwedel, Univ. Dortmund, Informatik 12, 2006 Universität Dortmund Periodic scheduling For periodic scheduling, the best that we can do is to.
Priority Inheritance Protocols: An Approach to Real-Time Synchronization Real-Time Operating Systems Laboratory SoEE&CS, SNU.
Resource Access Protocols 張軒彬助理教授 中興大學資訊科學系. 嵌入式即時作業系統 2 Outline Priority Inversion Priority Inheritance Protocol.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
CS 149: Operating Systems February 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
UCDavis, ecs150 Fall /23/2007ecs150, fall Operating System ecs150 Fall 2007 : Operating System #3: Priority Inversion (a paper on the class.
UCDavis, ecs150 Spring /21/2006ecs150, spring Operating System ecs150 Spring 2006 : Operating System #3: Priority Inversion (paper) Dr. S.
Chapter 101 Multiprocessor and Real- Time Scheduling Chapter 10.
Resource management and Synchronization Akos Ledeczi EECE 354, Fall 2010 Vanderbilt University.
Introduction to Embedded Systems Rabie A. Ramadan 6.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
CS333 Intro to Operating Systems Jonathan Walpole.
A presentation for Brian Evans’ Embedded Software Class By Nate Forman Liaison Technology Inc. 3/30/2000 For Real-Time Scheduling.
Priority Inversion BAE5030 Advanced Embedded Systems 9/13/04.
Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
1 Real-Time Scheduling. 2Today Operating System task scheduling –Traditional (non-real-time) scheduling –Real-time scheduling.
Spring 2002Real-Time Systems (Shin) Rate Monotonic Analysis Assumptions – A1. No nonpreemptible parts in a task, and negligible preemption cost –
1. System Characteristics Features of Real-Time Systems Implementing Real-Time Operating Systems Real-Time CPU Scheduling An Example: VxWorks5.x.
Process Scheduling. Scheduling Strategies Scheduling strategies can broadly fall into two categories Co-operative scheduling is where the currently.
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
Scheduling Algorithms for Multiprogramming in a Hard Real-Time Environment (then and now) EECS 750 – Spring 2006 Presented by: Shane Santner, TJ Staley,
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
SCHEDULING Kshama Desai Bijal Shah Kishore Putta Kashyap Sheth.
CHAPTER 6 CPU SCHEDULING 1. Process Scheduling In most programs, there is alternating between I/O bursts and CPU bursts like: Waiting time Sum of.
Fakultät für informatik informatik 12 technische universität dortmund Resource Access Protocols Peter Marwedel Informatik 12 TU Dortmund Germany 2008/12/06.
© 2017 SlidePlayer.com Inc. All rights reserved.