Operating Systems Lecture 15.

Slides:



Advertisements
Similar presentations
Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
Advertisements

Topic : Process Management Lecture By: Rupinder Kaur Lecturer IT, SRS Govt. Polytechnic College for Girls,Ludhiana.
Operating Systems CPU Scheduling. Agenda for Today What is Scheduler and its types Short-term scheduler Dispatcher Reasons for invoking scheduler Optimization.
CPU Scheduling Algorithms
02/06/2008CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 5-CPU Scheduling
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Process CPUArrival Time P P2 3 0 P3 3 0 The Gantt Chart for the schedule is: Waiting time for P1 = (7-7)=0; P2 = (0-0)=0; P3 = (3-0)
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
CPU Scheduling Algorithms CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
lecture 5: CPU Scheduling
CPU SCHEDULING.
Chapter 6: CPU Scheduling
Dan C. Marinescu Office: HEC 439 B. Office hours: M, Wd 3 – 4:30 PM.
Chapter 5a: CPU Scheduling
CPU Scheduling Algorithms
CPU scheduling 6. Schedulers, CPU Scheduling 6.1. Schedulers
Process Scheduling B.Ramamurthy 9/16/2018.
Scheduling (Priority Based)
CPU Scheduling.
Chapter 6: CPU Scheduling
Process management Information maintained by OS for process management
ICS 143 Principles of Operating Systems
Process Scheduling B.Ramamurthy 11/18/2018.
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Lecture 16 Syed Mansoor Sarwar
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System Concepts
So far…. Firmware identifies hardware devices present
3: CPU Scheduling Basic Concepts Scheduling Criteria
Process Scheduling B.Ramamurthy 12/5/2018.
Chapter5: CPU Scheduling
COT 4600 Operating Systems Spring 2011
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Outline Scheduling algorithms Multi-processor scheduling
Operating System Concepts
COT 4600 Operating Systems Fall 2009
CGS 3763 Operating Systems Concepts Spring 2013
Chapter 5: CPU Scheduling
Lecture 2 Part 3 CPU Scheduling
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Process Scheduling B.Ramamurthy 4/19/2019.
Process Scheduling B.Ramamurthy 4/24/2019.
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Module 5: CPU Scheduling
Process Scheduling B.Ramamurthy 5/7/2019.
CPU SCHEDULING CPU SCHEDULING.
CPU Scheduling: Basic Concepts
Chapter 6: CPU Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Presentation transcript:

Operating Systems Lecture 15

© Copyright Virtual University of Pakistan Agenda for Today Review of previous lecture Shortest-job-first Round-Robin scheduling Multi-level queues scheduling Multi-level feedback queues scheduling Recap of lecture 21 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Review of Lecture 14 Short-term scheduler Dispatcher Reasons for invoking scheduler Preemptive and non-preemptive schedulers Optimization criteria FCFS 21 November 2018 © Copyright Virtual University of Pakistan

Shortest-Job-First (SJF) Scheduling Process with the shortest CPU burst is scheduled first. Non-preemptive – once CPU given to a process it cannot be preempted until completes its CPU burst. 21 November 2018 © Copyright Virtual University of Pakistan

Shortest-Job-First (SJF) Scheduling Preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt it—Shortest-Remaining-Time-First (SRTF). SJF is optimal non-preemptive scheduling algorithm – gives minimum average waiting time for a given set of processes. 21 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Non-Preemptive SJF Process Arrival Time Burst Time P1 0.0 7 P2 2.0 4 P3 4.0 1 P4 5.0 4 Gantt chart Average waiting time = (0+6+3+7)/4 = 4 P1 P3 P2 7 16 P4 12 21 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Preemptive SJF Process Arrival Time Burst Time P1 0.0 7 P2 2.0 4 P3 4.0 1 P4 5.0 4 Gantt chart Average waiting time = (9 + 1 + 0 +2)/4 = 3 P3 P2 4 2 11 P4 5 7 P1 16 21 November 2018 © Copyright Virtual University of Pakistan

SJF—CPU Burst of a Process Can only estimate the length of the next CPU burst. Can be done by using the length of previous CPU bursts, using exponential averaging. 21 November 2018 © Copyright Virtual University of Pakistan

Exponential Averaging Estimation based on historical data tn = Length of nth CPU burst n+1 = Estimate for n+1st CPU burst , 0 ≤  ≤1 n+1 = tn + (1- ) n 21 November 2018 © Copyright Virtual University of Pakistan

Exponential Averaging Plugging in value for n, we get n+1 = tn + (1- )[tn-1 + (1- )n-1] = tn + (1- )tn-1 + (1- )2n-1 Continuing like this results in n+1 =  tn+ (1 - )  tn-1 + … + (1 - )j  tn-j + … + (1 - )n+1 0 21 November 2018 © Copyright Virtual University of Pakistan

Exponential Averaging If  = 0 n+1 = n Actual previous bursts do not count If  = 1 n+1 = tn Estimates do not count 21 November 2018 © Copyright Virtual University of Pakistan

Exponential Averaging Typical value used for  is ½. With this value, our n+1st estimate is Hence the name exponential averaging n+1 = tn/2 + tn-1/22 + tn-2/23 + tn-3/24 + … 21 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Priority Scheduling A priority number (integer) is associated with each process The CPU is allocated to the process with the highest priority (smallest integer  highest priority). Preemptive Non-preemptive 21 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Priority Scheduling SJF is a priority scheduling where priority is the predicted next CPU burst time. Problem  Starvation – low priority processes may never execute. Solution  Aging – as time progresses increase the priority of the process. 21 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Recap of Lecture Shortest-Job-First (SJF) Shortest-Remaining-Time-First (SRTF) Exponential averaging Priority scheduling Recap of lecture 21 November 2018 © Copyright Virtual University of Pakistan