Uniprocessor Scheduling I

Slides:



Advertisements
Similar presentations
Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Advertisements

Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
1 Uniprocessor Scheduling Types of scheduling –The aim of processor scheduling is to assign processes to be executed by the processor so as to optimize.
Chapter 9 Uniprocessor Scheduling
A. Frank - P. Weisberg Operating Systems Advanced CPU Scheduling.
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
Ceng Operating Systems Chapter 2.2 : Process Scheduling Process concept  Process scheduling Interprocess communication Deadlocks Threads.
Day 25 Uniprocessor scheduling. Algorithm: Selection function Selection function – which process among ready processes to select. w – time spent in system,
Chapter 3: CPU Scheduling
Chapter 9 Uniprocessor Scheduling
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
6/25/2015Page 1 Process Scheduling B.Ramamurthy. 6/25/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
Chapter 9 Uniprocessor Scheduling
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
Informationsteknologi Tuesday, October 9, 2007Computer Systems/Operating Systems - Class 141 Today’s class Scheduling.
7/12/2015Page 1 Process Scheduling B.Ramamurthy. 7/12/2015Page 2 Introduction An important aspect of multiprogramming is scheduling. The resources that.
1 Lecture 10: Uniprocessor Scheduling. 2 CPU Scheduling n The problem: scheduling the usage of a single processor among all the existing processes in.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
Chapter 9 Uniprocessor Scheduling Seventh Edition By William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals.
1 CPU Scheduling & Deadlock Operating Systems Lecture 4.
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 9 Uniprocessor Scheduling Seventh Edition By William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals.
Uniprocessor Scheduling
CPU Scheduling Chapter 6 Chapter 6.
Chapter 6: CPU Scheduling
10CSE CPU Scheduling Copyrights Lecture Slides adapted from “ Advanced Operating Systems ”, Lecture Notes by Prof. Prof. Daniel Mosse, University Of Pittsburgh,
Lecture 5: Uniprocessor Scheduling
1 Uniprocessor Scheduling Chapter 9. 2 CPU Scheduling We concentrate on the problem of scheduling the usage of a single processor among all the existing.
Chapter 9 Uniprocessor Scheduling Spring, 2011 School of Computer Science & Engineering Chung-Ang University.
Chapter 9 Uniprocessor Scheduling 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,
Chapter 6 CPU SCHEDULING.
Chapter 9 Uniprocessor Scheduling Seventh Edition By William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals.
Operating System Chapter 9. Uniprocessor Scheduling
Uniprocessor Scheduling Chapter 9. Aim of Scheduling To improve: Response time: time it takes a system to react to a given input Turnaround Time (TAT)
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Minimize response time Maximize throughput Maximize processor efficiency.
Fall 2000M.B. Ibáñez Lecture 11 Uniprocessor Scheduling.
1 Uniprocessor Scheduling Chapter 9. 2 CPU Scheduling n We concentrate on the problem of scheduling the usage of a single processor among all the existing.
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
Operating System 9 UNIPROCESSOR SCHEDULING. TYPES OF PROCESSOR SCHEDULING.
Uniprocessor Scheduling Chapter 9. Processor Scheduling Processor scheduling determines the assignment of processes to be executed by the processor over.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Assign processes to be executed by the processor or processors: –Response time –Throughput –Processor.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
Uniprocessor Scheduling Chapter 9 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Uniprocessor Scheduling
CPU Scheduling Chapter 5.
Uniprocessor Scheduling
Chapter 2.2 : Process Scheduling
Process Scheduling B.Ramamurthy 9/16/2018.
Operating Systems CPU Scheduling.
Chapter 6: CPU Scheduling
OverView of Scheduling
Uniprocessor scheduling
Operating System Chapter 9. Uniprocessor Scheduling
TDC 311 Process Scheduling.
Chapter 9 Uniprocessor Scheduling
Operating System 9 UNIPROCESSOR SCHEDULING
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
Uniprocessor scheduling
Uniprocessor Scheduling
Uniprocessor Scheduling
Operating Systems Concepts
Presentation transcript:

Uniprocessor Scheduling I Chapter 9

Goals of Scheduling Quick response time Fast throughput Processor efficiency

Type of Scheduling (1) Long-term Medium-term performed when new process is created The decision to add to the pool of processes to be executed (chapter 3, process control) Medium-term swapping The decision to add to the number of processes that are partially or fully in main memory (chapter 7 and 8, control structure)

Types of Scheduling Short-term I/O which ready process to execute next decision as to which ready process will be executed by the processor (chatter 9 and 10) I/O decision as to which process’s pending I/O request shall be handled by available I/O device (chapter 11)

Scheduling and Process State Transition New Long-term scheduling Long-term scheduling Ready, suspend Running Exit Ready Short-term scheduling Medium-term scheduling Blocked, suspend Blocked Medium-term scheduling

A Seven-State Model - States Ready: The process is in main memory and available for execution. Blocked: The process is in main memory and awaiting an event. Blocked, suspend: The process is in secondary memory and awaiting an event. Ready, suspend: The process is in secondary memory but is available for execution as soon as it is loaded into main memory.

Queuing Diagram for Scheduling Long-term scheduling Time-out Batch jobs Short-term scheduling Ready Queue Processor Release Medium-term scheduling Interactive users Ready, Suspend Queue Medium-term scheduling Blocked, Suspend Queue Blocked Queue Event Wait Event Occurs

Long-Term Scheduling Determines which programs are admitted to the system for processing Controls the degree of multiprogramming More processes, smaller percentage of time each process is executed

Medium-Term Scheduling Swapping Based on the need to manage multiprogramming

Short-Term Scheduling Known as the dispatcher Invoked when an event occurs clock interrupts I/O interrupts operating system calls signals

Short-Tem Scheduling Criteria User-oriented Related to the behavior of the system as perceived by the individual user or process. Response Time: Elapsed time between the submission of a request until there is output. System-oriented The focus if on effective and efficient utilization of the processor

Short-Term Scheduling Criteria Performance-related Performance-related criteria are quantitative and generally can be readily measured. measurable such as response time and throughput Not performance related predictability: a given job should run in about the same amount of time and at about the same cost regardless of the load on the system

Priorities 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 may suffer starvation allow a process to change its priority based on its age or execution history

Priority Queuing A set of queues to instead of a single ready queue RQ0 Processor Release Dispatch A set of queues to instead of a single ready queue RQ1 . . Admit . RQn Priority [RQi] >[RQj] for i<j Preemption Event Wait Event occurs Blocked Queue

Decision Mode Nonpreemptive Preemptive 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 operating system Allows for better service since any one process cannot monopolize the processor for very long

An Example for Scheduling Policies Process Service Time Arrival Time 1 3 2 2 6 3 4 4 6 4 5 5 8 2

First-Come-First-Served (FCFS) 5 10 15 20 Each process joins the Ready queue When the current process ceases to execute, the oldest process in the Ready queue is selected 1 2 3 4 5

Turnaround Time and Service Time Turnaround Time Tq - the total time that the item spends in the system (waiting time plus service time, or finish time mines arrival time). Service Time Ts - Finish Time minus Start Time. Normalized Turnaround Time - the ratio of turnaround time to service time Tq / Ts

FCFS -Normalized Turnaround Time Process Arrival Serve Start Finish Turnaround Tq/Ts Time Time Ts Time Time Time Tq A 0 1 0 1 1 1 B 1 100 1 101 100 1 C 2 1 101 102 100 100 D 3 100 102 202 199 1.99 Mean 100 26

Difficulties with First-Come-First-Served A short process may have to wait a very long time before it can execute Favors CPU-bound processes CPU-bound processes: the processes mostly use processor. I/O processes have to wait until CPU-bound process completes

Round-Robin q=1 Uses preemption based on a clock 5 10 15 20 Uses preemption based on a clock An amount of time is determined that allows each process to use the processor for that length of time Next ready job is selected. 2 Ready Time 1 2 3 5 7 10 2 14 4 6 9 3 13 6 8 4 16 12 8 5 11

Round-Robin q=4 7 Ready Time 2 4 Ready Time 6 15 8 5 10 15 20 1 7 Ready Time 2 2 4 3 Ready Time 6 15 4 8 5 P2 rest part ready time is 7 P4 rest part ready time is 15 P5 ready time is 8 P4 rest part ready time is 15 P5 ready time is 8