CH 5. CPU Scheduling 2015-04-14. 5.1 Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading.

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.
CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
OS, , Part II CPU Scheduling Department of Computer Engineering, PSUWannarat Suntiamorntut.
Operating Systems Process Scheduling (Ch 3.2, )
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 17 Scheduling III.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
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.
Chapter 3: CPU Scheduling
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.
Scheduling in Batch Systems
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Cs238 CPU Scheduling Dr. Alan R. Davis. CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Chapter 5-CPU Scheduling
Job scheduling Queue discipline.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
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.
Operating Systems Part III: Process Management (CPU Scheduling)
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CPU Scheduling Introduction to Operating Systems: Module 13.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
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.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Processor Scheduling Hank Levy. 22/4/2016 Goals for Multiprogramming In a multiprogramming system, we try to increase utilization and thruput by overlapping.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
CPU Scheduling G.Anuradha Reference : Galvin. CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time.
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.
CPU SCHEDULING.
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Lecture 2 Part 3 CPU Scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Presentation transcript:

CH 5. CPU Scheduling

5.1 Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading new PCB  dispatcher u give control of the CPU to the process selected by the CPU scheduler F CPU-I/O Burst Cycle  Process execution begins with a CPU burst

5.1 Basic Concepts Alternating sequence of CPU and I/O bursts Load store add store read from file Wait for I/O Store increment index write to file Wait for I/O Load store add store read from file Wait for I/O CPU burst I/O burst CPU burst I/O burst frequency burst duration (milliseconds) Histogram of CPU-burst times

5.2 Scheduling Criteria F Performance comparison criteria of CPU scheduling algorithm  CPU utilization : 40% ~ 90%  throughput : finished job # per time unit  turnaround time : waiting time in the Ready Queue  response time : interactive system F preemptive & nonpreemptive Scheduling  context switching : pure overhead (PCB save, load) F Interval timer & interrupting clocking  prevent a monopoly of system F Deadline Scheduling  pay remnant cost for processing in explicit time

5.3 Scheduling Algorithms 1.FIFO(FCFS) CBACPU Finish  Nonpreemptive Ex) Job Burst Time  If arriving order  1, 2, 3  If arriving order is 2, 3, 1 A.T.T = ( ) / 3 = 13 A.W.T = ( ) / 3 = 3 Job1 Job2 Job Average Turnaround Time = ( )/3 = 27 Average Waiting Time = ( )/3 = 17 ms

5.3 Scheduling Algorithms 2.Round Robin Scheduling for Timesharing System Time Quantum of Time Slice (10 ~ 100 msec) New job Preemptive Finish Ex) In the case of jobs in previous example, if time quantum is 4, Average turnaround time is -- J1 J2 J3 J1 J1 · · · · · J1 47 / 3  16 Average Waiting Time = ( (10 - 4)) / 3 = 17 / 3 = 5.66 ms  R.R Scheduling = Preemptive Scheduling Time Quantum : if large FCFS short like processor sharing context switching overhead

5.3 Scheduling Algorithms Process time = 10 Quantum Context switches Showing how a smaller time quantum increases context switching

5.3 Scheduling Algorithms Average turnaround time Process time P 1 6 P 2 3 P 3 1 P 4 7 Time quantum Showing how turnaround time varies with the time quantum

5.3 Scheduling Algorithms 3.Shortest - Job - First (SJF)  Non preemptive Scheduling  Long - Term Scheduling in Batch system : good.  Short-Term Scheduling : impossible u A.W.T = ( )/4 = 7 ms. –FCFS A.W.T = ( )/4 = 41/4 = ms. –AVG Turnaround Time = ( )/4 = 52/4 = 13 ms. Job Burst Time J 4 J 1 J 3 J 2

5.3 Scheduling Algorithms 4.Shortest-Remaining-Time-First(SRT)  Transformation of Shortest-Job-First  Preemptive SJF u A.W.T = ((10-1) + (1-1) + (17 -2) + (5-3))/4 = 26/4 = 6.5 ms. –A.T.T = 17 + (5-1) + (26-2) + (10-3) =52/4 = 13 ms. –SJF A.T.T = ms. –SJF A.W.T = 5.75 ms. Ex) Job Arrive Time Burst Time * Assign the Thrasholded Value J 1 J 2 J 4 J 1 J

5.3 Scheduling Algorithms 5.Priority Scheduling  SJF : Special case of the general priority scheduling.  FCFS : Equal priority.  Major problem : indefinite blocking or starvation. u Solution  HRN Ex) Job Burst Time Priority J 2 J 5 J 1 J 3 J A.W.T = 8.2 ms A.T.T = 12 ms

5.3 Scheduling Algorithms 6.HRN(Highest-Response-ratio-Next) : Brinch Hansen  priority = (Waiting Time + Service Time) / Service Time  Nonpreemptive method that apply process service time and total time to wait service

5.3 Scheduling Algorithms 7.Multilevel Queue  processes each job classified into queues  ex) classify into Foreground and Background (80% : 20%) u F.G is scheduled by Round Robin algorithm u B.G is scheduled by an FCFS algorithm system processes Interactive processes Interactive editing processes batch processes student processes highest priority lowest priority Multilevel Queue scheduling

5.3 Scheduling Algorithms 8.Multilevel Feedback Queue  allow a process to move between queues quantum = 8 quantum = 16 FCFS Fig 5.7 Multilevel feedback queues

5.5 Real-Time Scheduling F Hard real-time  within a guaranteed time F soft real-time  less restrictive

5.6 Algorithm Evaluation F Deterministic modeling ProcessBurst Time P 1 10 P 2 1 P 3 2 P 4 1 P 5 5  maximize CPU utilization  maximize throughput) F Queueing Models  result mathematical formula that estimate the distribution of CPU and I/O bursts. F Simulations

5.6 Algorithm Evaluation FCFS RR (Quantum=1) S.J.F F Evaluation method  Analytical evaluation u use mathematical analysis by predetermined workload, … u ex) Deterministic modeling  Queuing Model u mathematical formula, arrival rate, service rate èutilization, queue length, wait time  Simulation