Scheduling of processes

Similar documents
Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

Chapter 9 Uniprocessor Scheduling

Uniprocessor Scheduling. Chapter 9

Chapter 9. Uniprocessor Scheduling

Uniprocessor Scheduling

Today s class. Scheduling. Informationsteknologi. Tuesday, October 9, 2007 Computer Systems/Operating Systems - Class 14 1

Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

Lecture Topics. Announcements. Today: Uniprocessor Scheduling (Stallings, chapter ) Next: Advanced Scheduling (Stallings, chapter

Chapter 5: CPU Scheduling

CPU Scheduling. Rab Nawaz Jadoon. Assistant Professor DCS. Pakistan. COMSATS, Lahore. Department of Computer Science

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

Scheduling. The Basics

CPU Scheduling. Schedulers. CPSC 313: Intro to Computer Systems. Intro to Scheduling. Schedulers in the OS

Course Syllabus. Operating Systems

Unit 3 : Process Management

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

CS3733: Operating Systems

Last Class: Processes

Operating Systems ECE344. Ding Yuan

CPU Scheduling Algorithms

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

Announcements. Program #1. Reading. Due 2/15 at 5:00 pm. Finish scheduling Process Synchronization: Chapter 6 (8 th Ed) or Chapter 7 (6 th Ed)

Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms

1.1 CPU I/O Burst Cycle

Scheduling Bits & Pieces

Properties of Processes

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

Operating Systems. Scheduling

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

8: Scheduling. Scheduling. Mark Handley

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

Ch 4 : CPU scheduling

CSE 120 Principles of Operating Systems Spring 2017

Operating System Concepts Ch. 5: Scheduling

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

COSC243 Part 2: Operating Systems

Operating Systems. Lecture Process Scheduling. Golestan University. Hossein Momeni

CS370 Operating Systems

A COMPARATIVE STUDY OF CPU SCHEDULING POLICIES IN OPERATING SYSTEMS

CHAPTER 2: PROCESS MANAGEMENT

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

CSE 120. Fall Lecture 8: Scheduling and Deadlock. Keith Marzullo

CSL373: Lecture 6 CPU Scheduling

CS418 Operating Systems

Process Scheduling. Copyright : University of Illinois CS 241 Staff

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

CPU Scheduling (1) CPU Scheduling (Topic 3) CPU Scheduling (2) CPU Scheduling (3) Resources fall into two classes:

CSE 120 Principles of Operating Systems

OPERATING SYSTEMS: Lesson 4: Process Scheduling

CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts

CSE 4/521 Introduction to Operating Systems

Scheduling in the Supermarket

Chapter 5: CPU Scheduling

Process- Concept &Process Scheduling OPERATING SYSTEMS

Scheduling. Scheduling. Scheduling. Scheduling Criteria. Priorities. Scheduling

Operating System Review Part

3. CPU Scheduling. Operating System Concepts with Java 8th Edition Silberschatz, Galvin and Gagn

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

Chapter 5 CPU scheduling

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Chapter 6: CPU Scheduling

Operating Systems. Process scheduling. Thomas Ropars.

Operating Systems Unit 3

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

Lecture 2 Process Management

Start of Lecture: February 10, Chapter 6: Scheduling

Topic 4 Scheduling. The objective of multi-programming is to have some process running at all times, to maximize CPU utilization.

CPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31

Project 2: CPU Scheduling Simulator

Frequently asked questions from the previous class survey

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Frequently asked questions from the previous class survey

Last class: Today: CPU Scheduling. CPU Scheduling Algorithms and Systems

SMD149 - Operating Systems

Titolo presentazione. Scheduling. sottotitolo A.Y Milano, XX mese 20XX ACSO Tutoring MSc Eng. Michele Zanella

by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science

CMPS 111 Spring 2003 Midterm Exam May 8, Name: ID:

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Scheduling. CSC400 - Operating Systems. 7: Scheduling. J. Sumey. one of the main tasks of an OS. the scheduler / dispatcher

CS370 Operating Systems

CISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College

OPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:

Opera&ng Systems ECE344

Chapter 5: CPU Scheduling

Job Scheduling. CS170 Fall 2018

CPU Scheduling: Objectives

CS307: Operating Systems

CSE 120. Summer, Inter-Process Communication (IPC) Day 3. Inter-Process Communication (IPC) Scheduling Deadlock. Instructor: Neil Rhodes

CSCE Operating Systems Scheduling. Qiang Zeng, Ph.D. Fall 2018

Chapter 5: CPU Scheduling. Operating System Concepts Essentials 8 th Edition

Interactive Scheduling

Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule

Transcription:

Scheduling of processes

Processor scheduling Schedule processes on the processor to meet system objectives System objectives: Assigned processes to be executed by the processor Response time Throughput Processor efficiency 2

Processor scheduling Scheduling involves managing queues to minimize queuing delay Four types: Long-term Medium-term Short-term I/O scheduling (not this chapter) 3

4

Long-Term Scheduling Determines which programs are admitted to the system for processing Controls the degree of multiprogramming Add a new process if there is a need to increase degree of multiprogramming More processes, smaller percentage of time each process is executed 5

Medium-Term Scheduling Part of the swapping function Based on the need to manage the degree of multiprogramming If too many processes, will swap a process to disk (suspension). 6

Short-Term Scheduling Scheduler known as the dispatcher Executes most frequently Invoked when an event occurs Clock interrupts I/O interrupts Operating system calls Signals (from semaphores) New process enters the system 7

Short-Term Scheduling Criteria User-oriented Response time (interactive process) Elapsed time between the submission of a request until there is output Turnaround time (batch process) Elapsed time between submission of a job and its completion System-oriented Effective and efficient utilization of the processor E.g. throughput, processor utilization 8

Short-Term Scheduling Criteria Performance related Quantitative Measurable E.g. response time and throughput Not performance related Qualitative Can t measure easily E.g. predictability, fairness 9

Scheduling criteria are interrelated The scheduling criteria are interdependent E.g. good response time may require frequent process switching This would mean a lot of overhead Hence lower throughput 10

Priority-base scheduling policies Scheduler will always choose a process of higher priority over one of lower priority Have multiple ready queues to represent each level of priority Lower-priority processes may suffer starvation allow a process to change its priority based on its age or execution history 11

12

Alternative scheduling policies Require a selection function Determines which among ready processes to select Function may be based on resource management or execution characteristics of processes three quantities are important w time spent in system, waiting and executing so far e time spent in execution so far s total service time required by the process the time that the process actually runs (includes e) 13

Alternative scheduling policies Use decision mode to specify 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 Selection function used only when a process blocks or terminates Preemptive Running process may be interrupted and moved to ready queue Allows for better service since any one process cannot monopolize the processor for very long More switching overhead Selection function is used 14

FCFS/FIFO policy Each process joins the ready queue When the current process ceases to execute, the oldest process in the ready queue is selected nonpreemptive A short process may have to wait a very long time before it can execute 15

FCFS example Process Arrival time P1 0 24 P2 1 3 P3 2 3 Burst length Calculate turnaround time for each process and the average turnaround time turnaround time = total time process spends in the system (wait + service) 16

FCFS Favors CPU-bound processes I/O processes have to wait until CPU-bound process completes Rarely used on its own 17

Process Scheduling Example 18

(FCFS) 0 5 10 15 20 A B C D E 19

Round robin scheduling policy Uses preemptive decision mode Preempt a process using a clock interrupt A process is allowed to run for a time-slice or quantum The next process in the ready queue is selected to run following the preemption (FIFO) Prevents large processes from monopolizing the processor Known as time slicing 20

Round robin scheduling policy Design issue length of quantum Short quantum short processes will finish quickly lots of process switches Choose such that typical processes can complete without being interrupted 21

Round robin scheduling policy Unfair to I/O-bound processes They typically do not use a complete quantum CPU-bound processes do Use virtual round robin Use an auxiliary queue to hold processes that have I/O requests serviced Process in auxiliary queue gets preference over those in the main ready queue Process from the auxiliary queue runs for remaining time from last time-slice 22

23

Shortest-Process-Next (SPN) Uses nonpreemptive decision mode Selects process with shortest expected processing time next Reduces the response time for shorter processes Less predictable response time for longer processes Must estimate the running time for each process 25

Shortest Remaining Time (SRT) Preemptive version of SPN Check when a new process enters the system AND when the current process voluntarily releases the processor Better response time as short jobs given immediate preference Fewer process switches than Round robin Must keep track of elapsed time 27

Highest Response Ratio Next (HRRN) Response ratio wait s s wait time spent waiting for the processor s expected service time 29

HRRN scheduling policy Uses nonpreemptive decision mode Select the process that has the highest response ratio Short process (small s ) given preference Long process(large s ) that has been waiting a long time (large wait ) is given preference Accounts for age of process Must estimate s 30

Multi-level Feedback scheduling Uses preemptive decision mode (time quantum) Maintain many ready queues of varying priorities Each queue uses FIFO A process that is preempted is moved to a lower priority ready queue Thus longer processes are penalized Don t have to estimate running time Note: If there are no processes waiting, don t preempt current process 32

33

Multi-level Feedback (quantum = 1) 0 5 10 15 20 A B C D E 34

Multi-level Feedback (quantum = 2 i ) With quantum = 1 long processes will have very large turnaround time In this case a process in queue RQi will run for quantum = 2 i 35

Fair-Share Scheduling Treat multiple processes and threads of a user as a collection The performance of the collection of threads is optimized not just that of any one thread or process Fair share scheduling ensures that users are given a fair share of the processor time 37

Fair-Share Scheduling Divide user community into groups Each user process priority is based on the process execution time and the execution time of processes within the same group 38