CMT603 Lecture 4 Scheduling-2. Contents Last Week –FCFS –SJF Priority scheduling Round Robin Multi Level Queues Real Systems –Linux –XP.

Slides:



Advertisements
Similar presentations
CPU Scheduling.
Advertisements

Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
Process Control Management Prepared by: Dhason Operating Systems AICT
OS, , Part II CPU Scheduling Department of Computer Engineering, PSUWannarat Suntiamorntut.
CH 5. CPU Scheduling Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 17 Scheduling III.
 Basic Concepts  Scheduling Criteria  Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 16 Scheduling II.
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.
Operating Systems CPU Scheduling. Agenda for Today What is Scheduler and its types Short-term scheduler Dispatcher Reasons for invoking scheduler Optimization.
Scheduling Algorithms
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.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CPU-Scheduling Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. The short term scheduler.
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Scheduler What is the job of.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Chapter 6 CPU SCHEDULING.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
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.
CPU Scheduling Basic Concepts. Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: Process Scheduling.
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.
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.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Operating Systems CPU Scheduling Algorithms
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Introduction to Operating System Created by : Zahid Javed CPU Scheduling Fifth Lecture.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
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.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 6: CPU Scheduling.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
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.
CPU SCHEDULING.
Priority Scheduling Example
Scheduling (Priority Based)
CPU Scheduling.
Chapter 6: CPU Scheduling
Operating System Concepts
Outline Scheduling algorithms Multi-processor scheduling
Exercise Ms.Reema alOraini
Processor Scheduling Hank Levy 1.
Shortest-Job-First (SJR) Scheduling
CPU SCHEDULING CPU SCHEDULING.
Prof. Deptii Chaudhari.
CPU Scheduling.
Chapter 5: CPU Scheduling
Presentation transcript:

CMT603 Lecture 4 Scheduling-2

Contents Last Week –FCFS –SJF Priority scheduling Round Robin Multi Level Queues Real Systems –Linux –XP

Priority Scheduling A priority is associated with each process, and the CPU is allocated to the process with the highest priority. We assume that low numbers represent high priority. May be preemptive or non-preemptive.

Example: Priority Scheduling Consider the following set of processes with their arrival times and the length of the CPU-burst time given in milliseconds The arrival order of the processes is P1, P2, P3, P4, P5 ProcessArrival TimePriorityBurst time P10310 P2011 P3042 P4051 P5025

Example: Priority Scheduling Proc ess Arrival Time Prio rity Burst time P10310 P2011 P3042 P4051 P5025 P2P5P1P3P Average wait time= ( )/5 = 8.2

Exercise ProcessArrival TimePriorityBurst time P1038 P2511 P3842 P41051 P51125 P2P5P1P3P P1 T=5 T=6T=8T=9 8 T= T= T=11 T= Average wait time = ( )/5 = 1.6

Analysis of Priority Scheduling May leave some low-priority processes waiting indefinitely for CPU –Starvation. Aging – a technique of gradually increasing the priority of processes that have waited for a long time.

Round Robin Similar to FCFS but with preemption. Have a time quantum (time slice). –Let the first process in the queue run until it exceeds the time quantum, then run the next process. The arrival order of the processes is P1,P2,P3 ProcessArrival TimeBurst Time P1024 P203 P309

Example: Round Robin ProcessArrival TimeBurst Time P1024 P203 P309 Time Quantum = 5 milliseconds P1P2P3P1P3P Average waiting Time = ( )/3 = 10 Time Quantum = 24 milliseconds P1P2P3 Average waiting Time = ( )/3 = Turns into FCFS scheduling

Exercise: Round Robin ProcessArrival TimeBurst Time P1024 P203 P309 Time quantum = 2 milliseconds P1 P2 P What if context-switch time = 1 millisecond? Average waiting Time = ( )/3 = Total context-switch time =12

Analysis of Round Robin Scheduling Very small quantum - large context switch overhead. Very big quantum - turns into FCFS. The time quantum should be large with respect to the context-switch time. –In most modern OSs Quantum time range: milliseconds Context-switch time: <10 microseconds

Scheduling algorithms. FCFS, SJF, Priority, Round Robin. Preemptive, Non preemptive All Basic Algorithms –Real life systems have a mix of these approaches

Multi level Queues Separate scheduling within queues Scheduling between queues Foreground processes (Round Robin) Background processes (FCFS) Queue Scheduler (Priority)

Linux Priority Queue –0-99 real time – nice Higher priority = longer time slice Once time slice is expired, wait for all other slices to expire

XP 32 Level Priority Algorithm in two classes –1-15 Variable –16-31 Real time –Also 0 for memory management FIFO queue in each level. When Quantum runs out in Variable Class priority drops –Limits CPU intensive processes Foreground windows +3 priority

Summary Last Week –FCFS –SJF Priority scheduling Round Robin Multi Level Queues Real Systems –Linux –XP

Group Discussion For 5-10 minutes, discuss how you would design a scheduling algorithm for a Desktop PC, using multilevel queues.

Exercise sheet