CPU Scheduling ( Basic Concepts)

Slides:



Advertisements
Similar presentations
Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
Advertisements

Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: 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.
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Scheduling in Batch Systems
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
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
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
Chapter 6 CPU SCHEDULING.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
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.
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
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CPU Scheduling CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
lecture 5: CPU Scheduling
CPU SCHEDULING.
Chapter 5a: CPU Scheduling
Process Scheduling B.Ramamurthy 9/16/2018.
Scheduling (Priority Based)
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Operating Systems CPU Scheduling.
Process management Information maintained by OS for process management
Process Scheduling B.Ramamurthy 11/18/2018.
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 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
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 5: CPU Scheduling
Lecture 2 Part 3 CPU Scheduling
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 2/23/2019.
Q:何謂 CPU BURST與 I/O BURST?
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
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 ( Basic Concepts) Which process will get the CPU when it is available? This is decided by the O.S. and is called CPU scheduling. The part of the O.S. which performs scheduling is called Scheduler. The scheduler selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. The objective is to maximize CPU utilization in multiprogramming. CPU–I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

Alternating Sequence of CPU And I/O Bursts execute CPU Burst I/O Wait I/O Burst execute CPU Burst I/O Wait I/O Burst

Important Definitions Term Description Preemptive Scheduling After allocation the CPU can be taken away from a process. Non Preemptive Scheduling After its allocation the CPU cannot be taken away from a process; process can voluntarily release the CPU. CPU Bound Process A process which heavily uses the CPU and performs a little I/O I/O Bound Process A process performs I/O very frequently Throughput No. of processes that complete their execution per time unit Turnaround time Amount of time to execute a particular process Waiting time Amount of time a process has been waiting in the ready queue Response time Time between submitting a request and getting the first response, not output (in a time-sharing environment)

Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min response time

Scheduling Algorithms First-Come, First-Served (FCFS) Scheduling ( non preemptive) Process CPU Burst (B) (msec) Wait Time (W) W/B P1 25 P2 40 0.625 P3 03 65 21.667 P4 12 68 5.667 This algorithm favors: Longer jobs against the shorter jobs ( W/B is less for longer jobs) CPU bound processes against I/O bound processes

Shortest Job first Scheduling Now the jobs appear as: Process CPU Burst (B) (msec) Wait Time (W) W/B P3 03 P4 12 0.25 P1 25 15 0.65 P2 40 1.00 Now: Longer jobs are not favored against the shorter jobs ( W/B is less for longer jobs) A longer job can face starvation CPU bound processes are still favored against I/O bound processes

Round-Robin (RR) Scheduling (Preemptive) A queue of ready processes is maintained A time quantum q (10-100 msec) is allocated to each process. I f a process does not finish in the allocated time it goes back to the end of the queue (circular queue) If there are n processes, each process gets turn at most after (n-1) q units. Gannt Chart for q = 20 msec CPU CPU … P1 P4 P3 P2 Performance If q is large, this scheme degenerates to FCFS If q is small, more context switches (each process finishes in more turns)