CPU Scheduling Gursharan Singh Tatla 1-Feb-20111www.eazynotes.com.

Slides:



Advertisements
Similar presentations
Topic : Process Management Lecture By: Rupinder Kaur Lecturer IT, SRS Govt. Polytechnic College for Girls,Ludhiana.
Advertisements

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
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.
Modified from Silberschatz, Galvin and Gagne ©2009 Lecture 8 Chapter 5: CPU Scheduling.
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
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
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.
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
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.
CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize.
Process Program (Passive Entity) is a sequence of instructions, written to perform a specified task on a computer. A computer requires programs to function,
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.
CPU Scheduling CSCI Introduction By switching the CPU among processes, the O.S. can make the system more productive –Some process is running at.
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.
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.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
CPU SCHEDULING.
Chapter 5a: CPU Scheduling
Chapter 3: Process-Concept
Process Scheduling B.Ramamurthy 9/16/2018.
Chapter 6: CPU Scheduling
Operating Systems CPU Scheduling.
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Operating System Concepts
So far…. Firmware identifies hardware devices present
3: CPU Scheduling Basic Concepts Scheduling Criteria
Process Scheduling B.Ramamurthy 12/5/2018.
Chapter5: CPU Scheduling
TDC 311 Process Scheduling.
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 5: CPU Scheduling
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Process Scheduling B.Ramamurthy 4/19/2019.
Process Scheduling B.Ramamurthy 4/24/2019.
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Module 5: CPU Scheduling
Process Scheduling B.Ramamurthy 5/7/2019.
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
CPU Scheduling: Basic Concepts
Chapter 6: CPU Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Presentation transcript:

CPU Scheduling Gursharan Singh Tatla 1-Feb-20111www.eazynotes.com

CPU Scheduling Scheduling refers to selecting a process, from many ready processes, that is to be next executed on CPU. In multiprogramming environment, multiple processes are kept in main memory. When one process has to wait for I/O completion, operating system takes the CPU from that process and assigns it to another process. In this way, CPU is never idle and has some process to work on. 1-Feb-20112www.eazynotes.com

Scheduler Scheduler is an operating system module that selects the next job or process to be assigned to CPU. Thus, scheduler selects one of the many processes in memory that are ready to execute and allocates CPU to it. 1-Feb-20113www.eazynotes.com

Scheduler Scheduler is of three types: 1-Feb-20114www.eazynotes.com Long Term Scheduler 1 Medium Term Scheduler 2 Short Term Scheduler 3

Scheduler 1-Feb-20115www.eazynotes.com

Long Term Scheduler Long Term Scheduler selects the processes from secondary storage and loads them into memory for execution. It is called “long term” because the time for which the scheduling is valid is long. The frequency of execution of a long term scheduler is usually low, as there may be minutes between the creation of new processes in the system. 1-Feb-20116www.eazynotes.com

Long Term Scheduler The primary objective of long term scheduler is to control the “degree of multiprogramming”. Degree of multiprogramming refers to the total number of processes present in the memory. If the degree of multiprogramming is stable, then the average rate of process creation is equal to the average terminate rate. 1-Feb-20117www.eazynotes.com

Long Term Scheduler This scheduler shows the best performance by selecting the good mixture of I/O bound and CPU bound processes. I/O bound processes are those that spend most of their time in I/O. CPU bound processes are those that spend most of their time in computations. 1-Feb-20118www.eazynotes.com

Medium Term Scheduler The medium term scheduler is required at the time when a swapped-out process is to be brought into pool of ready processes. A running process may be suspended because of I/O request. Such a suspended process is then removed from main memory and stored in secondary memory. 1-Feb-20119www.eazynotes.com

Medium Term Scheduler This is done because there is a limit on the number of active processes that can reside in main memory. Therefore, a suspended process is swapped-out from main memory. At some later time, the process can be swapped-in into the main memory. All versions of Windows use swapping. 1-Feb www.eazynotes.com

Short Term Scheduler Short term scheduler selects one process from many ready processes that are residing in main memory and allocates CPU to one of them. Thus, it handles the scheduling of the processes that are in ready state. Short term scheduler is also known as CPU Scheduler. 1-Feb www.eazynotes.com

Short Term Scheduler As compared to long term scheduler, a short term scheduler has to work very often. The frequency of execution of short term scheduler is high. It must select a new process for CPU frequently. 1-Feb www.eazynotes.com

Preemptive & Non-Preemptive Scheduling A scheduling algorithm can be: 1-Feb www.eazynotes.com Preemptive Scheduling 1 Non-Preemptive Scheduling 2

A scheduling is non-preemptive if, once a process has been given the CPU, the CPU cannot be taken away from the process. In other words, in non-preemptive scheduling, once the CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or by entering the waiting state. 1-Feb www.eazynotes.com

Preemptive Scheduling A scheduling is preemptive if the CPU can be taken away from a process after being allocated. In other words, even if the CPU has been allocated to a certain process, it can be snatched from the process any time either due to time constraint or due to priority reason. 1-Feb www.eazynotes.com

Dispatcher Dispatcher is a program responsible for assigning the CPU to the process, which has been selected by the short term scheduler. Dispatching a process involves context switching. 1-Feb www.eazynotes.com

Scheduling Criteria The goal of a scheduling algorithm is to identify the process whose selection will result in the best possible system performance. The various scheduling criteria for evaluating an algorithm are discussed next. 1-Feb www.eazynotes.com

Scheduling Criteria CPU Utilization: ◦ CPU utilization is the average fraction of time during which the processor is busy. ◦ The level of CPU utilization depends on the load on the system. ◦ CPU utilization may range from 0 to 100%. 1-Feb www.eazynotes.com

Scheduling Criteria Throughput: ◦ It refers to the number of processes the system can execute in a period of time. ◦ For long processes, this rate may be 1 process per hour. ◦ For short processes, throughput may be 10 processes per second. ◦ Thus, evaluation of throughput depends on the average length of a process. 1-Feb www.eazynotes.com

Scheduling Criteria Turnaround Time: ◦ This is the interval of time between the submission of a process and its completion. ◦ Thus, turnaround time is an average period of time it takes a process to execute. ◦ Turnaround time includes actual execution time plus time spent waiting for resources and doing I/O. 1-Feb www.eazynotes.com

Scheduling Criteria Waiting Time: ◦ It is the average period of time a process spends waiting. ◦ Waiting time can be expressed as W(x) = T(x) – x ◦ where, W(x) is the waiting time ◦ T(x) is the turnaround time ◦ x is the actual execution time. 1-Feb www.eazynotes.com

Scheduling Algorithm Optimization Criteria The optimization criteria is: ◦ Max. CPU Utilization ◦ Max. Throughput ◦ Min. Turnaround Time ◦ Min. Waiting Time ◦ Min. Response Time 1-Feb www.eazynotes.com

2323-Oct-15www.eazynotes.com