3. CPU Scheduling. CPU Scheduling Process execution – a cycle of CPU execution and I/O wait – figure Preemptive Non-Preemptive.

Slides:



Advertisements
Similar presentations
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
Advertisements

 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 CS 3100 CPU Scheduling1. Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various.
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.
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.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
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
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  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: Process Scheduling.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Operating Systems (CS 340 D)
Operating System Principles Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
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.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
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.
Peng Lu. CPU Scheduling 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 4. Multiple-Processor Scheduling 5. Real-Time Scheduling 2.
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.
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.
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.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
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.
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 5a: CPU Scheduling
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
CPU Scheduling: Basic Concepts
Presentation transcript:

3. CPU Scheduling

CPU Scheduling Process execution – a cycle of CPU execution and I/O wait – figure Preemptive Non-Preemptive

The four circumstance 1. When a process switches from the running state to the waiting state 2. When a process switches from the running state to the ready state 3. When a process switches from the waiting state to the ready state 4. When a process terminates

scheduler Select one of the processes in the ready queue Short-term scheduling

Dispatcher gives the control of the CPU to the process selected by the scheduler functions – switching context – switching to user mode – jumping to the proper location in the user program to restart that program Dispatch latency : – the time it takes for dispatcher to stop one process and start another running.

Scheduling Criteria CPU utilization – % of time device is busy Throughput – the number of jobs completed per unit time Turnaround time – including I/O Waiting time Response time

Scheduling Goal fair among all processes max. the CPU utilization and throughput min. the turnaround / waiting / response time optimize the average measure minimize the max. response time – consider the worst case – interactive systems minimize the variance in the response time

Scheduling Algorithm consider only one CPU burst per process – execution units – ex) 10 milliseconds our measure of compare – average waiting time

FiFO Scheduling (1) First-come First-served Easily managed with a FiFO queue Fair The average waiting time is often quite long – 129 pages(Fifth Edition) One CPU-bound process and many I/O bound processes – I/O devices idle or CPU sits ilde Non-preemptive Troublesome for time sharing system

FiFO Scheduling (2) main ( ) { intsum,j=0; while( ){ sum += j; j++; } main( ) { FILE*fp; int j, buf[512]; fp = open(“tmp.dat”, “r+”); while( ){ j = read( fp, buf, sizeof(buf)); sum( buf, 256 ); wirte( fp, buf, 1024 ); } CPU-Bound Pr.I/O-Bound Pr.

SJF Scheduling Shortest-Job-First Scheduling Assign the CPU to the process that has the smallest next CPU burst If the same burst, FCFS Minimize the average waiting time Difficulty with the SJF – knowing the length of the next CPU request Non_preemptive

SRT Scheduling Preemptive version – shortest-remaining time first – shorter CPU burst of new arrival process than what is left of currently executing process – p 133

Priority Scheduling (1) Allocate CPU to the highest priority process – SJF : a special case of the general priority scheduling – equal-priority processes : FCFS order

Priority Scheduling (2) Priority –is defined either internally or externally –Static priority do not change through out execution time easy to implement low-overhead –Dynamic priority response to change more complex greater overhead  the increased responsiveness of the system

Priority Scheduling (3) –Purchased priority willing to pay a extra charge Non_preemptive or preemptive – when a new process arrives at the ready queue, – new process priority > running process Problem – indefinite blocking or starvation – unfair  aging

Deadline scheduling Schedule the certain jobs to be completed by a specific time or deadline – high value if delivered on time – worthless if delivered later than the deadline Very complex Real time systems – control system – etc.

HRN scheduling Highest Response-Ratio Next Non-preemptive Compensated version of SJF – longer jobs given favored treatment – the priority of each job is a function P = (waiting_time + service_time) /service_time

Round-Robin Scheduling (1) Time sharing system FCFS + time_quantum or time_slice – a time quantum : 10~100 ms Ready queue : circular queue Preempted

Round-Robin Scheduling (2) Maximum waiting time – “ n ” processes in the ready queue – time quantum : q – (n – 1) * q The effect of context switching –time quantum vs. the number of context switching –figure 5.4/5.5 (p. 136 ~137)

Multi_level queue scheduling (1) For situation in which processes are easily classified into different groups – foreground( interactive ) processes – background( batch ) processes Permanently assigned to a queues on entry to the systems – low scheduling overhead – inflexible

Multi_level Feedback Queue Scheduling (1) allows a process to move between queues separate processes with different CPU_burst characteristics – I/O bound process – CPU bound process – aging

Multi_level Feedback Queue Scheduling (2) Parameters of multi_level feedback q. – the number of queues – the scheduling algorithm for each q. – the method used to determine when to upgrade a process to a higher priority queue. when to demote a process to a lower priority queue. Which queue a process will enter when that process needs service.