Tutorial 4 Scheduling. Why do we need scheduling? To manage processes according to requirements of a system, like: –User responsiveness or –Throughput.

Slides:



Advertisements
Similar presentations
Scheduling Introduction to Scheduling
Advertisements

Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
© 2004, D. J. Foreman 1 Scheduling & Dispatching.
Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
CS 149: Operating Systems February 3 Class Meeting
CH 5. CPU Scheduling Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading.
Operating Systems Process Scheduling (Ch 3.2, )
CPU Management CT213 – Computing Systems Organization.
SCHEDULING Kshama Desai Bijal Shah Kishore Putta Kashyap Sheth.
CS4315A. Berrached:CMS:UHD1 CPU Scheduling Chapter 7.
Operating Systems Chapter 6
© Ibrahim Korpeoglu Bilkent University
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Operating Systems (CSCI2413) Lecture 4 Process Scheduling phones off (please)
OUTLINE What is the Process Management? What is it covers? pprocess state pprocess table, pprocess scheduling.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
Job scheduling Queue discipline.
1 Lecture 10: Uniprocessor Scheduling. 2 CPU Scheduling n The problem: scheduling the usage of a single processor among all the existing processes in.
CSS430 CPU Scheduling1 Textbook Ch5 These slides were compiled from the Applied OSC textbook slides (Silberschatz, Galvin, and Gagne) and the instructor’s.
CPU Scheduling Chapter 6 Chapter 6.
Chapter 4 Processor Management
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
More Scheduling cs550 Operating Systems David Monismith.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Scheduling Chap 2. Scheduling Introduction to Scheduling (1) Bursts of CPU usage alternate with periods of I/O wait –a CPU-bound process –an I/O bound.
Scheduling Strategies Operating Systems Spring 2004 Class #10.
ICS Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
CPU Scheduling Algorithms Simulation using Java Kaushal Sinha CSC 4320 Spring 2007.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
RTOS task scheduling models
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
Processor Scheduling Hank Levy. 22/4/2016 Goals for Multiprogramming In a multiprogramming system, we try to increase utilization and thruput by overlapping.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Purpose of Operating System Part 2 Monil Adhikari.
1 CPU Scheduling 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.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
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 12 Scheduling Models for Computer Networks Dr. Adil Yousif.
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecture 5 Scheduling. Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Scheduling.
lecture 5: CPU Scheduling
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Networks and Operating Systems: Exercise Session 2
April 6, 2001 Gary Kimura Lecture #6 April 6, 2001
Chapter 2 Scheduling.
CPSC 457 Operating Systems
CPU Scheduling.
Process management Information maintained by OS for process management
Operating System Concepts
Chapter 5: CPU Scheduling
TDC 311 Process Scheduling.
Process Scheduling Decide which process should run and for how long
Chapter 5: CPU Scheduling
Process Management Scheduling
Processor Scheduling Hank Levy 1.
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
Uniprocessor Scheduling
CPU Scheduling.
Chapter 5: CPU Scheduling
Presentation transcript:

Tutorial 4 Scheduling

Why do we need scheduling? To manage processes according to requirements of a system, like: –User responsiveness or –Throughput Performance of a scheduler is determined mainly by: –Context switch time –Scheduling policy

1, 2, 3, 4, 5, 6, Context Switch! Switching from one process running on the CPU to another process Saves all the registers of outgoing process (to memory), then loads all the registers of incoming process (from memory) Can be time-costly; mostly hardware- dependent

Scheduling The mechanism that determines when the CPU will be allocated to processes, and in what order Two classes of scheduling strategies: –Nonpreemptive (aka Batch) –Preemptive

Non-preemptive policies Allow any process to run to completion once it has been allocated to the CPU. Current process does not get interrupted. Some examples: –First Come First Serve (FCFS) –Shortest Job Next (SJN) –Priority scheduling –Deadline scheduling

Preemptive policies Allow another process to interrupt current process if: –It has a higher priority –The time quantum has elapsed Some examples: –Round Robin –Multiple-level Queues

Scheduling examples Given three threads, their execution times and I/O needs, apply scheduling policies Threads are placed on ready queue in order: T1, T2 then T3 * Specific to Round Robin: –Time Quantum of 3ms –Context switch time considered negligible in this example

First Come First Serve ThreadCPU1 st I/O2 nd I/O T110 msn/a T215 msat 2ms for 5msn/a T312 msat 4ms for 2msat 8ms for 2ms CPU: I/O:

Shortest Job First (Nonpreemptive) ThreadCPU1 st I/O2 nd I/O T110 msn/a T215 msat 2ms for 5msn/a T312 msat 4ms for 2msat 8ms for 2ms CPU: I/O:

Shortest Job First (Preemptive) ThreadCPU1 st I/O2 nd I/O T110 msn/a T215 msat 2ms for 5msn/a T312 msat 4ms for 2msat 8ms for 2ms CPU: I/O:

Priority (Preemptive) ThreadPrioCPU1 st I/O2 nd I/O T1210 msn/a T2315 msat 2ms for 5msn/a T3112 msat 4ms for 2msat 8ms for 2ms 1 23 CPU: I/O:

Round Robin ThreadCPU1 st I/O2 nd I/O T110 msn/a T215 msat 2ms for 5msn/a T312 msat 4ms for 2msat 8ms for 2ms 1 23 CPU: I/O:

Recapping Scheduling in Java Java and prior (“green”) threads: Threads are managed by Java VM One thread runs at a time Thread is only taken off the CPU when: –it yields –it blocks (on a resource) –it exits –a higher priority thread becomes runnable (not always)

New-Style Scheduling in Java Post versions of Java: Threads are managed by the host OS Allows multiple threads to run “concurrently” Thread is taken off the CPU as in previous versions, but also –when its time quantum expires (if supported by OS)