Copyright ©: Nahrstedt, Angrave, Abdelzaher

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

CS 149: Operating Systems February 3 Class Meeting
WELCOME TO THETOPPERSWAY.COM
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 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Chapter 4 Processor Management
Chapter 6 CPU SCHEDULING.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
CSC 322 Operating Systems Concepts Lecture - 10: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
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.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Scheduling.
CPU Scheduling Optimization of CPU scheduling implies
OPERATING SYSTEMS CS 3502 Fall 2017
lecture 5: CPU Scheduling
Copyright ©: Nahrstedt, Angrave, Abdelzaher
CPU SCHEDULING.
CS 3733 Operating Systems Topics: Process (CPU) Scheduling
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
April 6, 2001 Gary Kimura Lecture #6 April 6, 2001
Operating Systems Processes Scheduling.
CPU scheduling 6. Schedulers, CPU Scheduling 6.1. Schedulers
Process Scheduling B.Ramamurthy 9/16/2018.
Scheduling (Priority Based)
CPU Scheduling.
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Process management Information maintained by OS for process management
CS 143A - Principles of Operating Systems
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Introduction What is an operating system bootstrap
Lecture 21: Introduction to Process 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
TDC 311 Process Scheduling.
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU SCHEDULING.
CPU scheduling decisions may take place when a process:
Chapter 5: CPU Scheduling
Lecture 21: Introduction to Process Scheduling
Processor Scheduling Hank Levy 1.
Process Scheduling B.Ramamurthy 4/11/2019.
Process Scheduling B.Ramamurthy 4/7/2019.
Uniprocessor scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Module 5: CPU Scheduling
CPU SCHEDULING CPU SCHEDULING.
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
Scheduling 21 May 2019.
CPU Scheduling ( Basic Concepts)
Chapter 6: CPU Scheduling
Don Porter Portions courtesy Emmett Witchel
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
CPU Scheduling CSE 2431: Introduction to Operating Systems
Presentation transcript:

Copyright ©: Nahrstedt, Angrave, Abdelzaher Scheduling Copyright ©: Nahrstedt, Angrave, Abdelzaher

Content of This Lecture Copyright ©: Nahrstedt, Angrave, Abdelzaher Content of This Lecture Why CPU scheduling? Basic scheduling algorithms FIFO (FCFS) Shortest job first Round Robin Priority Scheduling Goals: Understand how your program is executed on the machine together with other programs

Review: State Process Model Copyright ©: Nahrstedt, Angrave, Abdelzaher Review: State Process Model

OS Representation of Process via Process Control Block (PCB) Copyright ©: Nahrstedt, Angrave, Abdelzaher OS Representation of Process via Process Control Block (PCB)

Copyright ©: Nahrstedt, Angrave, Abdelzaher Process Scheduling Deciding which process/thread should occupy the resource (CPU, disk, etc) CPU I want to play Whose turn is it? Process 2 Process 3 Process 1

Copyright ©: Nahrstedt, Angrave, Abdelzaher Context Switch Switch CPU from one process to another Performed by scheduler It includes: save PCB state of the old process; load PCB state of the new process; Flush memory cache; Change memory mapping (TLB); Context switch is expensive (1-1000 microseconds) No useful work is done (pure overhead) Can become a bottleneck Need hardware support

Copyright ©: Nahrstedt, Angrave, Abdelzaher When to schedule? A new process starts The running process exits The running process is blocked I/O interrupt (some processes will be ready) Clock interrupt (every 10 milliseconds)

Queuing Diagram for Processes Copyright ©: Nahrstedt, Angrave, Abdelzaher Queuing Diagram for Processes Create Job CPU Ready Queue I/O request in Device Queue I/O Time Slice Expired Update Accounting Fork a Child Create Child Interrupt Occurs Wait for an Interrupt

Preemptive vs. Non-preemptive scheduling Copyright ©: Nahrstedt, Angrave, Abdelzaher Preemptive vs. Non-preemptive scheduling Non-preemptive scheduling: The running process keeps the CPU until it voluntarily gives up the CPU process exits switches to blocked state 1 and 4 only (no 3) Preemptive scheduling: The running process can be interrupted and must release the CPU (can be forced to give up CPU) 4 Terminated Running 1 3 Ready Blocked

Scheduling Objectives Copyright ©: Nahrstedt, Angrave, Abdelzaher Scheduling Objectives Fairness (equitable shares of CPU) Priority (most important first) Efficiency (make best use of equipment) Encouraging good behavior (can’t take advantage of the system) Support for heavy loads (degrade gracefully) Adapting to different environments (interactive, real-time, multi-media)

Copyright ©: Nahrstedt, Angrave, Abdelzaher Performance Criteria Fairness Efficiency: keep resources as busy as possible Throughput: # of processes that completes in unit time Turnaround Time (also called elapse time) amount of time to execute a particular process from the time its entered Waiting Time amount of time process has been waiting in ready queue Response Time amount of time from when a request was first submitted until first response is produced. predictability and variance Proportionality: meet users' expectation Meeting Deadlines: avoid losing data

Copyright ©: Nahrstedt, Angrave, Abdelzaher Process Profiles I/O – Bound Does too much I/O to keep CPU busy CPU – Bound Does too much computation to keep I/O busy Process Mix Scheduling should load balance between I/O bound and CPU-bound processes Ideal would be to run all equipment at 100% utilization but that would not necessarily be good for response time

Simple Processor Scheduling Algorithms Copyright ©: Nahrstedt, Angrave, Abdelzaher Simple Processor Scheduling Algorithms Batch systems First Come First Serve (FCFS) Shortest Job First Interactive Systems Round Robin Priority Scheduling …

First Come First Serve (FCFS) Copyright ©: Nahrstedt, Angrave, Abdelzaher First Come First Serve (FCFS) Process that requests the CPU FIRST is allocated the CPU FIRST. Also called FIFO Preemptive or Non-preemptive? Used in Batch Systems Implementation FIFO queues A new process enters the tail of the queue The schedule selects from the head of the queue.

Copyright ©: Nahrstedt, Angrave, Abdelzaher FCFS Example Process Duration Order Arrival Time P1 24 1 P2 3 2 P3 4 The final schedule: P1 (24) P2 (3) P3 (4) 24 27 P1 waiting time: 0 P2 waiting time: 24 P3 waiting time: 27 The average waiting time: (0+24+27)/3 = 17 What if P1 arrives at time 2

Copyright ©: Nahrstedt, Angrave, Abdelzaher Problems with FCFS Non-preemptive Not optimal AWT Cannot utilize resources in parallel: Assume 1 process CPU bounded and many I/O bounded processes result: Convoy effect, low CPU and I/O Device utilization Why?

Copyright ©: Nahrstedt, Angrave, Abdelzaher Summary Why Scheduling? Scheduling objectives Scheduling Algorithms FCFS (FIFO)