April 6, 2001 Gary Kimura Lecture #6 April 6, 2001

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

Chap 5 Process Scheduling. Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU–I/O Burst Cycle – Process execution consists of a.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Basic Concepts Maximum CPU utilization.
CS212: OPERATING SYSTEM Lecture 3: Process Scheduling 1.
1 CSE451 Scheduling Autumn 2002 Gary Kimura Lecture #6 October 11, 2002.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 5: CPU Scheduling Basic.
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.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
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.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
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 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
lecture 5: CPU Scheduling
CPU SCHEDULING.
Chapter 6: CPU Scheduling
Dan C. Marinescu Office: HEC 439 B. Office hours: M, Wd 3 – 4:30 PM.
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Chapter 5a: CPU Scheduling
Process Scheduling B.Ramamurthy 9/16/2018.
Scheduling (Priority Based)
CPU Scheduling.
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Process management Information maintained by OS for process management
CPU Scheduling Basic Concepts Scheduling Criteria
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System Concepts
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
Operating systems Process scheduling.
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU SCHEDULING.
Outline Scheduling algorithms Multi-processor scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
CSE 451: Operating Systems Winter 2003 Lecture 6 Scheduling
Processor Scheduling Hank Levy 1.
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
Chapter 6: CPU Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
CSE 451: Operating Systems Winter 2001 Lecture 6 Scheduling
Presentation transcript:

April 6, 2001 Gary Kimura Lecture #6 April 6, 2001 CSE451 Scheduling Spring 2001 Gary Kimura Lecture #6 April 6, 2001 CSE 451 Introduction to Operating Systems

Today Finish comparing user and kernel threads Whether it be processes or threads that are the basic execution unit the OS needs to some way of scheduling each process time on the CPU Why? To make better utilization of the system

Goals for Multiprogramming In a multiprogramming system, we try to increase utilization and throughput by overlapping I/O and CPU activities. This requires several os policy decisions: Determine the multiprogramming level -- the number of jobs loaded in primary memory Decide what job is to run next to guarantee good service These decisions are long-term and short-term scheduling decisions, respectively. Short-term scheduling executes more frequently, changes of multiprogramming level are more costly.

Scheduling The scheduler is a main component in the OS kernel It chooses processes/threads to run from the ready queue. The scheduling algorithm determines how jobs are scheduled. In general, the scheduler runs: When a process/thread switches from running to waiting When an interrupt occurs When a process/thread is created or terminated In a preemptive system, the scheduler can interrupt a process/thread that is running. In a non-preemptive system, the scheduler waits for a running process/thread to explicitly block

Preemptive and Non-preemptive Systems In a non-preemptive system the OS will not stop a running jobs until the job either exists or does an explicit wait In a preemptive system the OS can potentially stop a job midstream in its execution in order to run another job Quite often a timer going off and the current jobs time-slice or quantum being exhausted will cause preemption

Preemptive and Non-preemptive System (continued) I cannot over emphasize the need to understand the difference between preemptive and non-preemptive systems Preemptive systems also come in various degrees Preemptive user but non-preemptive kernel Preemptive user and kernel This affects your choice of scheduling algorithm, OS complexity, and system performance

Scheduling Algorithms Criteria There are many possible criteria for evaluating a scheduling algorithm: CPU utilization Throughput Turnaround time Waiting time Response time In an interactive system, predictability may be more important than a low average but high variance. One OS goal is to give applications the illusion they are running unhindered by other jobs sharing the CPU and memory

Various Scheduling Algorithms First-come First-served Shortest Job First Priority scheduling Round Robin Multi-level queue We’ll examine each in turn

Scheduling Algorithms First-Come First-Served First-come First-served (FCFC) (FIFO) Jobs are scheduled in order of arrival to ready Q Typically non-preemptive Problem: Average waiting time can be large if small jobs wait behind long ones May lead to poor overlap of I/O and CPU time Job A B C B C Job A

Scheduling Algorithms Shortest Job First Shortest Job First (SJF) Choose the job with the smallest (expected) CPU burst Provability optimal min. average waiting time Problem: Impossible to know size of CPU burst (but can try to predict from previous activity) Can be either preemptive or non-preemptive Preemptive SJF is called shortest remaining time first

Scheduling Algorithms Priority Scheduling Choose next job based on priority For SJF, priority = expected CPU burst Can be either preemptive or non-preemptive Problem: Starvation: jobs can wait indefinitely Solution to starvation Age processes: increase priority as a function of waiting time

Scheduling Algorithms Round Robin Used for timesharing in particular Ready queue is treated as a circular queue (FIFO) Each process is given a time slice called a quantum It is run for the quantum or until it blocks Problem: Frequent context switch overhead

Scheduling Algorithms Multi-level Queues Probably the most common method used Implement multiple ready Queues based on the job priority Multiple queues allow us to rank each job’s scheduling priority relative to other jobs in the system Windows NT/2000 has 32 priority levels Each running job is given a time slice or quantum After each time slice the next job of highest priority is given a chance to run Jobs can migrate up and down the priority levels based on various activities

Multiple Processors Multiple processors (i.e., more than one CPU on the system) changes some of the scheduling strategies There are both heterogeneous systems and homogeneous systems There is also the notion of asymmetric multiprocessing and symmetric multiprocessing SMP is great but when we look at synchronization and locks we’ll understand why it is difficult to actually pull off.

Next time With so much potentially going on in the system how do we synchronize all of it?