Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs. Nonpreemptive Scheduling 8.4Priorities 8.5Scheduling Objectives.

Slides:



Advertisements
Similar presentations
CPU Scheduling Questions answered in this lecture: What is scheduling vs. allocation? What is preemptive vs. non-preemptive scheduling? What are FCFS,
Advertisements

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.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 2 nd Edition Chapter 6a: CPU Scheduling.
Operating Systems Chapter 6
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
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
Scheduling in Batch Systems
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.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (2) Process Management 10/03/2008 Yang Song (Prepared by Yang Song and.
Chapter 5-CPU Scheduling
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
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.
CPU Scheduling Chapter 6 Chapter 6.
Chapter 6: CPU Scheduling
 2004 Deitel & Associates, Inc. All rights reserved. 1 Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs.
Scheduling. Objectives – Fairness – Maximize throughput – Maximize the number of users receiving acceptable response times – Minimize overhead – Balance.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Lecture 11 Processor Scheduling Scheduling Algorithms Worker Threads and the Thread Pool.
Chapter 6 CPU SCHEDULING.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
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)
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Uniprocessor Scheduling
Operating System 9 UNIPROCESSOR SCHEDULING. TYPES OF PROCESSOR SCHEDULING.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
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.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Assign processes to be executed by the processor or processors: –Response time –Throughput –Processor.
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.
Introduction to Operating System Created by : Zahid Javed CPU Scheduling Fifth Lecture.
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.
Operating Systems Unit 5: – Processor scheduling – Java – Linux – Windows XP Operating Systems.
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.
1 Module 5: Scheduling CPU Scheduling Scheduling Algorithms Reading: Chapter
Basic Concepts Maximum CPU utilization obtained with multiprogramming
3. CPU Scheduling. CPU Scheduling Process execution – a cycle of CPU execution and I/O wait – figure Preemptive Non-Preemptive.
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
Uniprocessor Scheduling
Chapter 8 – Processor Scheduling
Operating Systems Processes Scheduling.
Chapter 2.2 : Process Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System Concepts
Chapter5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Presentation transcript:

Chapter 8 – Processor Scheduling Outline 8.1 Introduction 8.2Scheduling Levels 8.3Preemptive vs. Nonpreemptive Scheduling 8.4Priorities 8.5Scheduling Objectives 8.6Scheduling Criteria 8.7Scheduling Algorithms 8.7.1First-In-First-Out (FIFO) Scheduling 8.7.2Round-Robin (RR) Scheduling 8.7.3Shortest-Process-First (SPF) Scheduling 8.7.4Highest-Response-Ratio-Next (HRRN) Scheduling 8.7.5Shortest-Remaining-Time (SRT) Scheduling 8.7.6Multilevel Feedback Queues 8.7.7Fair Share Scheduling 8.8Deadline Scheduling 8.9Real-Time Scheduling 8.10Java Thread Scheduling

Objectives After reading this chapter, you should understand: –the goals of processor scheduling. –preemptive vs. nonpreemptive scheduling. –the role of priorities in scheduling. –scheduling criteria. –common scheduling algorithms. –the notions of deadline scheduling and real-time scheduling. –Java thread scheduling.

8.1 Introduction Processor scheduling policy –Decides which process runs at given time –Different schedulers will have different goals Maximize throughput Minimize latency Prevent indefinite postponement Complete process by given deadline Maximize processor utilization

8.3 Preemptive vs. Nonpreemptive Scheduling Preemptive processes –Can be removed from their current processor –Can lead to improved response times –Important for interactive environments –Preempted processes remain in memory Nonpreemptive processes –Run until completion or until they yield control of a processor –Unimportant processes can block important ones indefinitely

8.5 Scheduling Objectives Different objectives depending on system –Maximize throughput –Maximize number of interactive processes receiving acceptable response times –Maximize resource utilization –Avoid indefinite postponement –Enforce priorities –Minimize overhead –Ensure predictability Several goals common to most schedulers –Fairness –Predictability –Scalability

8.6 Scheduling Criteria Processor-bound processes –Use all available processor time I/O-bound –Generates an I/O request quickly and relinquishes processor Batch processes –Contains work to be performed with no user interaction Interactive processes –Requires frequent user input

8.7.1 First-In-First-Out (FIFO) Scheduling FIFO scheduling –Simplest scheme –Processes dispatched according to arrival time –Nonpreemptible –Rarely used as primary scheduling algorithm Q: Can indefinite postponement happen in a system using FIFO?

8.7.2 Round-Robin (RR) Scheduling Round-robin scheduling –Based on FIFO –Processes run only for a limited amount of time called a time slice or quantum –Preemptible –Requires the system to maintain several processes in memory to minimize overhead –Often used as part of more complex algorithms

8.7.2 Round-Robin (RR) Scheduling Quantum size –Determines response time to interactive requests –Very large quantum size Processes run for long periods Degenerates to FIFO –Very small quantum size System spends more time context switching than running processes –Middle-ground Long enough for interactive processes to issue I/O request Batch processes still get majority of processor time

8.7.3 Shortest-Process-First (SPF) Scheduling Scheduler selects process with smallest time to finish –Lower average wait time than FIFO Reduces the number of waiting processes –Potentially large variance in wait times –Nonpreemptive Results in slow response times to arriving interactive requests –Relies on estimates of time-to-completion Can be inaccurate or falsified –Unsuitable for use in modern interactive systems Highest-Response-Ratio-Next (HRRN) Scheduling Improves upon SPF scheduling –Still nonpreemptive –Considers how long process has been waiting –Prevents indefinite postponement

8.7.5 Shortest-Remaining-Time (SRT) Scheduling SRT scheduling –Preemptive version of SPF –Shorter arriving processes preempt a running process –Very large variance of response times: long processes wait even longer than under SPF –Not always optimal Short incoming process can preempt a running process that is near completion Context-switching overhead can become significant

8.7.6 Multilevel Feedback Queues Different processes have different needs –Short I/O-bound interactive processes should generally run before processor-bound batch processes –Behavior patterns not immediately obvious to the scheduler Multilevel feedback queues –Arriving processes enter the highest-level queue and execute with higher priority than processes in lower queues –Long processes repeatedly descend into lower levels Gives short processes and I/O-bound processes higher priority Long processes will run when short and I/O-bound processes terminate –Processes in each queue are serviced using round-robin Process entering a higher-level queue preempt running processes

Figure 8.4 Multilevel feedback queues Multilevel Feedback Queues

8.7.7 Fair Share Scheduling FSS controls users’ access to system resources –Some user groups more important than others –Ensures that less important groups cannot monopolize resources –Unused resources distributed according to the proportion of resources each group has been allocated –Groups not meeting resource-utilization goals get higher priority Figure 8.5 Standard UNIX process scheduler. The scheduler grants the processor to users, each of whom may have many processes. (Property of AT&T Archives. Reprinted with permission of AT&T.)

8.8 Deadline Scheduling Deadline scheduling –Process must complete by specific time –Used when results would be useless if not delivered on-time –Difficult to implement Must plan resource requirements in advance Incurs significant overhead Service provided to other processes can degrade 8.9 Real-Time Scheduling Real-time scheduling –Related to deadline scheduling –Processes have timing constraints –Also encompasses tasks that execute periodically

8.10 Java Thread Scheduling Java threading scheduler –Uses kernel-level threads if available –User-mode threads implement timeslicing Each thread is allowed to execute for at most one quantum before preemption –Threads can yield to others of equal priority Only necessary on nontimesliced systems Threads waiting to run are called waiting, sleeping or blocked

Group Discussion 11 4/1/08 1. We have looked into the following scheduling algorithms: FIFO, RR, SPF, HRRN, SRT, Multi-level feedback queue, FSS. Put the names in the appropriate lists. Preemptive: Nonpreemptive: Good throughput: User interactive processes have higher priority: Can have indefinite postponement: 2. True /False: (a). The scheduling algorithms listed in question 1 are commonly used high-level scheduling algorithms. (b). Real-time system generally use preemptive processor scheduling. (c). Timesharing systems generally use nonpreemptive processor scheduling 3. Why do we say multilevel feedback queues accomplish the following goals: (a). Favor short processes. (b). Favor I/O bound processes to improve I/O device utilization. (c). Determine the nature of a process as quickly as possible and schedule the process accordingly. 4. Five batch jobs A through E arrive at the system at almost the same time and form a queue of A,B, C, D, E. They have estimated running time of 10, 6, 2, 4 and 8 minutes respectively. Suppose that RR is used to schedule them. What is the turnaround time for C process? What is the turnaround time for D process?