Lecture 16 Syed Mansoor Sarwar

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

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 17 Scheduling III.
Operating Systems Chapter 6
Chap 5 Process Scheduling. Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU–I/O Burst Cycle – Process execution consists of a.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
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
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
02/06/2008CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Scheduling in Batch Systems
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
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.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Maximum CPU utilization.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
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.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 5: CPU Scheduling Basic.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Introduction to Operating System Created by : Zahid Javed CPU Scheduling Fifth Lecture.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
CPU Scheduling Algorithms CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
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
Scheduling (Priority Based)
Chapter 5: CPU Scheduling
CPU Scheduling.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Process management Information maintained by OS for process management
Chapter 5: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Operating Systems Lecture 15.
Lecture 6: Uniprocessor Scheduling(cont.)
Operating System Concepts
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
COT 4600 Operating Systems Spring 2011
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Outline Scheduling algorithms Multi-processor scheduling
Chapter 5: CPU Scheduling
CGS 3763 Operating Systems Concepts Spring 2013
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Presentation transcript:

Lecture 16 Syed Mansoor Sarwar Operating Systems Lecture 16 Syed Mansoor Sarwar

© Copyright Virtual University of Pakistan Agenda for Today Review of previous lecture SJF is optimal Round-Robin scheduling Multi-level queues scheduling Multi-level feedback queues scheduling Recap of lecture 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Review of Lecture 15 Shortest-Job-First (SJF) Shortest-Remaining-Time-First (SRTF) Exponential averaging Priority scheduling 20 November 2018 © Copyright Virtual University of Pakistan

n+1 = tn + (1- ) n Review of Lecture 15 Exponential Averaging for  = ½ n+1 = tn + (1- ) n n+1 = tn/2 + tn-1/22 + tn-2/23 + tn-3/24 + … 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan SJF is Optimal Logical Argument: Decrease in the wait times for short processes is much more than increase in the wait times for long processes P1 P2 P3 5 3 2 P3 P2 P1 2 3 5 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Round Robin (RR) Each process gets a small unit of CPU time, called time slice or quantum, which is usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue. 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Round Robin (RR) If there are n processes in the ready queue, the time quantum is q, and context switch time is tcs, then no process waits more than (n-1)(q+tcs) time units Used in time-sharing systems where response time is an important performance criteria 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Round Robin (RR) Performance q large  FCFS q small  q must be large with respect to context switch, otherwise overhead is too high. 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Round Robin Example Process Burst Time P1 53 — 33 — 13 P2 17 P3 68 — 48 — 28 — 8 P4 24 — 4 The Gantt chart with quantum 20 is: P1 P2 P3 P4 20 37 57 77 97 117 121 134 154 162 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Round Robin Example Process Turnaround Time Waiting Time P1 134 134 – 53 = 81 P2 37 37 – 17 = 20 P3 162 162 – 68 = 94 P4 121 121 – 24 = 97 Average waiting time = 73 Average waiting time for SJF = 38 Typically, higher average turnaround than SJF, but better response. 20 November 2018 © Copyright Virtual University of Pakistan

Quantum vs Context Switch Process Time = 10 Quantum Context Switches 12 0 6 1 1 9 20 November 2018 © Copyright Virtual University of Pakistan

Turnaround Time vs Quantum 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Multilevel Queues Ready queue is partitioned into separate queues: - foreground (interactive) - background (batch) Each queue has its own priority and scheduling algorithm: - foreground – RR - background – FCFS 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Multilevel Queues Scheduling must be done across queues. Fixed priority scheduling; i.e., serve all from foreground then from background. Time slice – each queue gets a certain percentage of CPU time, e.g., 80% to foreground in RR and 20% to background in FCFS 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Multilevel Queues 20 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Recap of Lecture SJF is optimal Round-Robin scheduling Multi-level queues scheduling 20 November 2018 © Copyright Virtual University of Pakistan