240-323 OS,2000 1 240-323, Part II CPU Scheduling Department of Computer Engineering, PSUWannarat Suntiamorntut.

Slides:



Advertisements
Similar presentations
CPU Scheduling.
Advertisements

Chapter 5: CPU Scheduling
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 ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
 Basic Concepts  Scheduling Criteria  Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
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
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.
02/04/2008CSCI 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.
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.
Chapter 6: CPU Scheduling
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Chapter 6 CPU SCHEDULING.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
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 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.
CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize.
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.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Purpose of Operating System Part 2 Monil Adhikari.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Introduction to Operating System Created by : Zahid Javed CPU Scheduling Fifth Lecture.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
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 G.Anuradha Reference : Galvin. CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time.
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.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
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.
Scheduling (Priority Based)
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Operating System Concepts
Chapter5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 5: CPU Scheduling
Q:何謂 CPU BURST與 I/O BURST?
Chapter 6: CPU Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Chapter 5: CPU Scheduling
Presentation transcript:

OS, , Part II CPU Scheduling Department of Computer Engineering, PSUWannarat Suntiamorntut

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Basic Concepts The basic problem is as follows: How can OS schedule the allocation of CPU cycles to processes in system, to achieve “good performance”? Scheduling is a fundamental OS function.

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut CPU- I/O Burst Cycle cpu burst I/O burst cpu burst I/O burst CPU burst I/O burst

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Preemptive Scheduling process switches from running -> waiting (I/O request,.. ) process switches from running -> ready (interrupt occur) process switches from waiting -> ready (completion of I/O) process terminate

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Dispatcher Module to give control of CPU to process selected by short-term scheduler. This function involves : - Switching context - Switching to user mode - Jumping to the proper location in user program to restart that program

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Scheduling Criteria CPU utilization : in a real system, it range from percents. Throughput : number of processes that are completed. Turnaround time : interval from time of submission to completion. Waiting time : time that a process spends waiting in ready queue. Response time : time from the submission of a request until the first response.

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Scheduling Algorithms First-come, First-served Scheduling (FCFS) mange with FIFO ProcessBurst Time P124 P23 P33 P1 P2 P Average wait time = 17

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut FCFS ProcessBurst Time P124 P23 P P3 P2 P1 Average wait time = 3

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Scheduling Algorithm Shortest-Job-First Scheduling mange with SJF, minimum average wait time ProcessBurst Time P16 P28 P37 P P4 P1 P3 P2 Average wait time = 7

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Shortest-remaining-time-First Scheduling mange with SJF, minimum average wait time ProcessArrival timeBurst Time P108 P214 P329 P P1 P2 P4 P1P3 Average wait time = 6.5 Scheduling Algorithm

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Scheduling Algorithm Priority Scheduling scheduling in term of high priority and low. ProcessBurst TimePriority P1103 P211 P323 P414 P552 P2 P5 P1 P3 P Average wait time = 8.2

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Scheduling Algorithm Round-Robin Scheduling round-robin (RR), especially for time-sharing. - time quantum, time slice = small unit of time ProcessBurst Time P124 P23 P33 If time quantum = 4 P1 P2 P3P1 P1 P1 P1 P Average wait time = 5.66

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Scheduling Algorithm Multilevel Queue Scheduling System process Highest priority Interactive process Interactive editing process Bath process student process lowest priority

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Scheduling Algorithm Multilevel Feedback Queue Scheduling Quantum = 8 Quantum = 16 FCFS

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Scheduling Algorithm ProcessBurst TimePriorityArrival time P11030 P2512 P3433 P4145 P5327 Do the example

OS, Department of Computer Engineering, PSUWannarat Suntiamorntut Next Lecture in Process Synchronization