Operating Systems CPU Scheduling.

Slides:



Advertisements
Similar presentations
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
Advertisements

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
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
Chapter 5-CPU Scheduling
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
A. Frank - P. Weisberg Operating Systems CPU Scheduling.
Modified from Silberschatz, Galvin and Gagne ©2009 Lecture 8 Chapter 5: CPU Scheduling.
1 Lecture 10: Uniprocessor Scheduling. 2 CPU Scheduling n The problem: scheduling the usage of a single processor among all the existing processes in.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Main Job: Assign processes to be executed by the processor(s) and processes to be loaded in main.
Chapter 6: CPU Scheduling
Chapter 6 CPU SCHEDULING.
CPU Scheduling Gursharan Singh Tatla 1-Feb-20111www.eazynotes.com.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Minimize response time Maximize throughput Maximize processor efficiency.
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.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Response time Throughput Processor efficiency.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Response time Throughput Processor efficiency.
Uniprocessor Scheduling
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: Process Scheduling.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Assign processes to be executed by the processor or processors: –Response time –Throughput –Processor.
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.
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
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
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.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
lecture 5: CPU Scheduling
CPU Scheduling CSSE 332 Operating Systems
Chapter 5a: CPU Scheduling
Chapter 3: Process-Concept
Uniprocessor Scheduling
Uniprocessor Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
So far…. Firmware identifies hardware devices present
3: CPU Scheduling Basic Concepts Scheduling Criteria
Process & its States Lecture 5.
Chapter5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 9 Uniprocessor Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Q:何謂 CPU BURST與 I/O BURST?
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Module 5: CPU Scheduling
CPU Scheduling: Basic Concepts
Chapter 3: Processes Process Concept Process Scheduling
Chapter 6: CPU Scheduling
Uniprocessor Scheduling
Uniprocessor Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Presentation transcript:

Operating Systems CPU Scheduling

Basic Concepts Maximum CPU utilization obtained with multiprogramming. CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution Burst/Service time = total processor time needed in one CPU-I/O burst cycle. 10 November 2018

Alternating Sequence of CPU And I/O Bursts 10 November 2018

Processes Processes can be described as either: CPU-bound process – spends more time doing computations; few very long CPU bursts I/O-bound process – spends more time doing I/O than computations, many short CPU bursts Jobs with long CPU burst time are CPU-bound jobs and are also referred to as “long jobs”. Jobs with short CPU burst time are IO-bound jobs and are also referred to as “short jobs”. CPU-bound processes have longer CPU bursts than I/O-bound processes. 10 November 2018

10 November 2018

10 November 2018

Schedulers Long-term scheduler (or job scheduler) Selects which processes should be brought into the ready queue Controls the degree of multiprogramming More processes, smaller percentage of time each process is executed Short-term scheduler (or CPU scheduler) Selects which process should be executed next and allocates Known as the dispatcher & Executes most frequently Invoked when an event occurs Clock interrupts, I/O interrupts, OS calls, Signals, CPU 10 November 2018

Addition of Medium Term Scheduling Part of the swapping function Based on the need to manage the degree of multiprogramming 10 November 2018

10 November 2018

10 November 2018

Schedulers (Cont) Short-term scheduler is invoked very frequently (milliseconds)  (must be fast) CPU scheduler: selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them Long-term scheduler is invoked very infrequently (seconds, minutes)  (may be slow) 10 November 2018

CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state 2. Switches from running to ready state 3. Switches from waiting to ready 4. Terminates Scheduling under 1 and 4 is nonpreemptive All other are preemptive 10 November 2018

Characterization of Scheduling Policies The selection function: determines which process in the ready queue is selected next for execution. The decision mode: specifies the instants in time at which the selection function is exercised. Nonpreemptive: Once a process is in the running state, it will continue until it terminates or blocks itself for I/O. Preemptive: Currently running process may be interrupted and moved to the Ready state by the OS. Allows for better service since any one process cannot monopolize the processor for very long. 10 November 2018

Dispatcher Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves: switching context switching to user mode jumping to the proper location in the user program to restart that program Dispatch latency – time it takes for the dispatcher to stop one process and start another running 10 November 2018

10 November 2018

Process Control Block Contains Account id Priority level Elapsed CPU time Start time Scheduled start time Maximum cpu time Memory allocation Run state and scheduling Memory management information Hardware state Signaling Access control Input and output Process id Parent process id Child process ids Process group id(s) User id Effective user id Group id(s) Effective group id(s) 10 November 2018

Scheduling Criteria CPU utilization: amount of time in percentage that a processor is busy. Throughput: No of processes completed per time unit. Turnaround time: the interval from time of submission to the time of completion (execution + waiting for resources/processor) Waiting time: sum of periods spent waiting in the ready queue Response time: time from submission of a request until the first response is produced. Deadline: Maximize no of processes meeting their deadlines ( imp for real time systems) 10 November 2018

Scheduling Algorithm Optimization Criteria Max CPU utilization Max throughput Min turnaround time Min waiting time Min response time 10 November 2018

CPU Scheduling Criteria User-oriented Response Time Elapsed time between the submission of a request until there is output. System-oriented Effective and efficient utilization of the processor Performance-related Quantitative Measurable such as response time and throughput 10 November 2018