# Calculate the average waiting time if the processes arrive in the order of: a). P1, P2, P3

Save this PDF as:

Size: px
Start display at page:

Download "Calculate the average waiting time if the processes arrive in the order of: a). P1, P2, P3"

## Transcription

1 Scheduling Algorithms: 1. First come First Serve: FCFS is the simplest non-preemptive algorithm. Processes are assigned the CPU in the order they request it. That is the process that requests the CPU first is allocated the CPU first. The implementation of FCFS is policy is managed with a FIFO(First in first out) queue. When the first job enters the system from the outside in the morning, it is started immediately and allowed to run as long as it wants to. As other jobs come in, they are put onto the end of the queue. When the running process blocks, the first process on the queue is run next. When a blocked process becomes ready, like a newly arrived job, it is put on the end of the queue. Advantages: 1.Easy to understand and program. With this algorithm a single linked list keeps track of all ready processes. 2.Equally fair., 3.Suitable specially for Batch Operating system. Disadvantages: 1.FCFS is not suitable for time-sharing systems where it is important that each user should get the CPU for an equal amount of arrival time. Consider the following set of processes having their burst time mentioned in milliseconds. CPU burst time indicates that for how much time, the process needs the cpu. Process P1 24 P2 3 P3 3 Burst Time Calculate the average waiting time if the processes arrive in the order of: a). P1, P2, P3

2 b). P2, P3, P1 a. The processes arrive the order P1, P2, P3. Let us assume they arrive in the same time at 0 ms in the system. We get the following gantt chart. P1 P2 P Waiting time for P1= 0ms, for P2 = 24 ms for P3 = 27ms Avg waiting time: ( )/3= 17 b. ) If the process arrive in the order P2,P3, P1 P2 0 3 P3 P Average waiting time: (0+3+6)/3=3. Average waiting time vary substantially if the process CPU burst time vary greatly. 2. Shortest Job First: When several equally important jobs are sitting in the i/p queue waiting to be started, the scheduler picks the shortest jobs first A B C D Original order: (Turn Around time) Here we have four jobs A,B,C,D with run times of 8, 4, 4 and 4 minutes respectively. By running them in that order the turnaround time for A is 8 minutes, for B 12 minutes, for C 16 minutes and for D 20 minutes for an average of 14 minutes. Now let us consider running these jobs in the shortest Job First. B C D and then A. the turnaround times are now, 4, 8, 12 and 20 minutes giving the average of 11. Shortest job first is probably optimal.

3 Consider the four jobs with run times of a, b,c,d. The first job finished at a, the second at a+b and so on. So the mean turnaround time is (4a+3b+2c+d)/4. It is clear that the a contributes more to the average than any other. So it should be the shortest one. The disadvantages of this algorithm is the problem to know the length of time for which CPU is needed by a process. The SJF is optimal when all the jobs are available simultaneously. The SJF is either preemptive or non preemptive. Preemptive SJF scheduling is sometimes called Shortest Remaining Time First scheduling. With this scheduling algorithms the scheduler always chooses the process whose remaining run time is shortest. When a new job arrives its total time is compared to the current process remaining time. If the new job needs less time to finish than the current process, the current process is suspended and the new job is started. This scheme allows new short jobs to get good service. Q). Calculate the average waiting time in 1). Preemptive SJF and 2). Non Preemptive SJF Note: SJF Default: (Non Preemptive) Process Arrival Time Burst Time P1 0 8 P2 1 4 P3 2 9 P4 3 5 a. Preemptive SJF ( Shortest Remaining Time First): At t=0ms only one process P1 is in the system, whose burst time is 8ms; starts its execution. After 1ms i.e., at t=1, new process P2 (Burst time= 4ms) arrives in the ready queue. Since its burst time is less than the remaining burst time of P1 (7ms) P1 is preempted and execution of P2 is started. Again at t=2, a new process P3 arrive in the ready queue but its burst time (9ms) is larger than remaining burst time of currently running process (P2 3ms). So P2 is not preempted and continues its execution. Again at t=3, new process P4 (burst time 5ms ) arrives. Again for same reason P2 is not preempted until its execution is completed. Page:73 Compiled by: daya

4 Waiting time of P1: 0ms + (10 1)ms = 9ms Waiting time of P2: 1ms 1ms = 0ms Waiting time of P3: 17ms 2ms = 15ms Waiting time of P4: 5ms 3ms = 2ms Avg waiting time: ( )/4 = 6.5ms Non-preemptive SJF: Since its non-preemptive process is not preempted until it finish its execution. Waiting time for P1: 0ms Waiting time for P2: (8-1)ms = 7ms Waiting time for P3: (17 2) ms = 15ms Waiting time for P4: (12 3)ms = 9ms Average waiting time: ( )/4 = 7.75ms 3. Round-Robin Scheduling Algorithms: One of the oldest, simplest, fairest and most widely used algorithm is round robin (RR). In the round robin scheduling, processes are dispatched in a FIFO manner but are given a limited amount of CPU time called a time-slice or a quantum. If a process does not complete before its CPU-time expires, the CPU is preempted and given to the next process waiting in a queue. The preempted process is then placed at the back of the ready list. If the the process has blocked or finished before the quantum has elapsed the CPU switching is done. Round Robin Scheduling is preemptive (at the end of time-slice) therefore it is effective in timesharing environments in which the system needs to guarantee reasonable response times for interactive users. The only interesting issue with round robin scheme is the length of the quantum. Setting the quantum too short causes too many context switches and lower the CPU efficiency. On the other hand, setting the quantum too long may cause poor response time and approximates FCFS. In any event, the average waiting time under round robin scheduling is on quite long. Consider the following set of processes that arrives at time 0 ms. Process Burst Time P1 20 P2 3 P3 4 If we use time quantum of 4ms then calculate the average waiting time using R-R scheduling.

5 According to R-R scheduling processes are executed in FCFS order. So, firstly P1(burst time=20ms) is executed but after 4ms it is preempted and new process P2 (Burst time = 3ms) starts its execution whose execution is completed before the time quantum. Then next process P3 (Burst time=4ms) starts its execution and finally remaining part of P1 gets executed with time quantum of 4ms. Waiting time of Process P1: 0ms + (11 4)ms = 7ms Waiting time of Process P2: 4ms Waiting time of Process P3: 7ms Average Waiting time: (7+4+7)/3=6ms 4. Priority Scheduling:

### Chapter 6: CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Operating System Concepts 6.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming. CPU I/O Burst Cycle

### Chapter 5: Process Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: Process Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling

### Types of jobs. CPU-bound vs. I/O-bound. Batch, Interactive, real time. Maximum CPU utilization obtained with multiprogramming

CPU Scheduling Types of jobs CPU-bound vs. I/O-bound Maximum CPU utilization obtained with multiprogramming Batch, Interactive, real time Different goals, affects scheduling policies CPU Scheduler Selects

### Chapter 5: Process Scheduling. Chapter 5: Process Scheduling

Chapter 5: Process Scheduling Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Operating Systems Examples Java Thread Scheduling Algorithm

### CPU Scheduling. Chapter 5

CPU Scheduling Chapter 5 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### KSU/CCIS CSC227 Tutorial # 4 CPU Scheduling SUMMER

KSU/CCIS CSC227 Tutorial # 4 CPU Scheduling SUMMER - 2010 Question # 1: Select the most appropriate answer for each of the following questions: 1. is the number of processes that complete their execution

### Introduction to Scheduling 1

CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms FCFS, SJF, RR Exponential Averaging Multi-level Queue Scheduling Performance Evaluation Scheduling Terminology Scheduling Terminology

### Process Scheduling. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Process Scheduling Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Basic Concepts Scheduling Criteria Scheduling Algorithms Windows NT Scheduler Topics Covered

### CPU Scheduling. Basic Concepts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times CPU. Alternating Sequence of CPU and I/O Bursts

Basic Concepts P CPU Scheduling CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating

### Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 1 Basic Concepts Maximum CPU utilization obtained

### W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems Instructor: Junfeng Yang Outline Introduction to scheduling Scheduling algorithms 1 Direction within course Until now: interrupts, processes, threads, synchronization Mostly mechanisms

### CPU Scheduling CS 571. CPU - I/O Burst Cycle. Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process

CPU Scheduling CS 571 1 CPU - I/O Burst Cycle Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process 2 1 Basic Concepts CPU I/O Burst Cycle Process execution consists

### CPU Scheduling. Multiprogrammed OS

CPU Scheduling Multiprogrammed OS Efficient Use of Processor By switching between jobs Thread scheduling and process scheduling often used interchangeably Which is done depends on implementation of O/S.

### Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Oct-03 1 Basic Concepts Maximum CPU utilization

### Basic Concepts. Chapter 6: CPU Scheduling. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Chapter 6: CPU Scheduling Basic Concepts Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Maximum CPU utilization obtained

### Module 5: CPU Scheduling

Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Operating System Concepts 5.1 Silberschatz and

### Q. 1 Q. 1 Q. 1 Q. 1. Discuss how the following pairs of scheduling criteria conflict in certain settings.

CPU and response time I/O device and CPU CPU and response time CPU and response time CPU and response time minimize context switching CPU minimize context switching CPU conflict tasks would need to wait

### Module 6: CPU Scheduling. Basic Concepts

Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Applied Operating System Concepts 6.1 Silberschatz,

### Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

### Scheduling I. Introduction to scheduling. Scheduling algorithms

Scheduling I Introduction to scheduling Scheduling algorithms 1 Role of Dispatcher vs. Scheduler Dispatcher Low-level mechanism Responsibility: context switch Scheduler High-level policy Responsibility:

### Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various scheduling algorithms

### Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

### CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes

Scheduling Objectives CPU SCHEDULING Enforcement of fairness in allocating resources to processes Enforcement of priorities Make best use of available system resources Give preference to processes holding

### Objectives. Concepts (2) Scheduler and interrupts. Concepts (1) Bursts

Objectives Operating Systems Part of E1.9 - Principles of Computers and Software Engineering Lecture 4: Process scheduling To introduce process scheduling algorithms Non-priority based Priority based Examine

### Chapter 6: CPU Scheduling. Operating System Concepts Essentials 2 nd Edition

Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

### Operating Systems Fall 2012 Lecture 4: CPU Scheduling

482000000000357 Operating Systems Fall 2012 Lecture 4: CPU Scheduling Assist. Prof. Ediz ŞAYKOL ediz.saykol@beykent.edu.tr Operating System - Main Goals Interleave the execution of the number of processes

### Student: Yu Cheng (Jade) ICS 412 Homework #4 October Process Burst Time Priority P P P P P 5 5 2

Student: Yu Cheng (Jade) ICS 412 Homework #4 October 19. 2009 Homework #4 Exercise 5.12: Consider the following set of processes, with the length of the CPU burst given in milliseconds: Process Burst Time

### Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

### CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling

CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Basic Concepts An OS must allocate resources amongst competing processes The resource

### CS720 - Operating Systems. CPU Scheduling

CS720 - Operating Systems CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Procesor Scheduling Real-Time Scheduling Algorithm Evaluation Slides derived from material in

### Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

### Lecture 5 CPU Scheduling

Lecture 5 CPU Scheduling (Uniprocessor System) 1 Lecture Contents 1. Basic Concepts 2. Scheduling Criteria 3. Scheduling Algorithms 2 Switching CPU among processes in multiprogrammed OSs makes a computer

### multiple processes are kept in memory simultaneously when one process is waiting, another process executes

Terminology. Reference: Section 4.2, 5.1 Time-sharing / multiprogramming Typical proc. alternates between CPU bursts and I/O bursts To maximize CPU utilization: multiple processes are kept in memory simultaneously

### Chapter 6: CPU Scheduling

Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Chapter 6: 6.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming.

### Chapter 5: Process Scheduling. Operating System Concepts with Java 8 th Edition

Chapter 5: Process Scheduling Operating System Concepts with Java 8 th Edition 5.1 Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms

### Basic Concepts (1) Multiprogramming requires CPU scheduling CPU-I/O burst cycle CPU scheduler

CPU Scheduling Basic Concepts (1) Multiprogramming requires CPU scheduling CPU-I/O burst cycle CPU scheduler Short-term scheduler Ready queue may be a FIFO queue, priority queue, tree, linked list, etc.

### CPU Scheduling. Operating System Concepts. Alternating Sequence of CPU And I/O Bursts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times

Operating System Concepts Module 5: CPU SCHEDULING Andrzej Bednarski, Ph.D. student Department of Computer and Information Science Linköping University, Sweden CPU Scheduling Basic Concepts Scheduling

### Module 6: CPU Scheduling. Basic Concepts. Alternating Sequence of CPU And I/O Bursts

Module 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation Applied Operating System Concepts 6.1 Basic Concepts

### CPU Scheduling. Date. 2/2/2004 Operating Systems 1

CPU Scheduling Date 2/2/2004 Operating Systems 1 Basic concepts Maximize CPU utilization with multi programming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

### Introduction to process scheduling. Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms

Lecture Overview Introduction to process scheduling Process scheduling and schedulers Process scheduling criteria Process scheduling algorithms First-come, first-serve Shortest-job-first Priority Round-robin

### Chapter 6: CPU Scheduling

1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 2 Basic Concepts Maximum CPU utilization

### Lecture 6- CPU Scheduling Continued

Lecture 6- CPU Scheduling Continued Instructor : Bibhas Ghoshal (bibhas.ghoshal@iiita.ac.in) Autumn Semester, 2015 Bibhas Ghoshal IOSY 332C & IOPS 332C: OS Autumn Semester, 2015 1 / 24 Shortest Remaining

### CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems Based on original slides by Silberschatz, Galvin and Gagne 1 Basic Concepts CPU I/O Burst Cycle Process execution

### Chapter 6: CPU Scheduling. Basic Concepts

1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### CPU Scheduling: Basic Concepts

CPU Scheduling: Basic Concepts Idea: Maximum CPU utilization obtained with multiprogramming" CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait" Dispatcher grants CPU

### CS420: Operating Systems

CPU Scheduling James Moscola Department of Engineering & Computer Science York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Scheduling Concepts

### Chapter 6: CPU Scheduling

Department of Electr rical Eng ineering, Chapter 6: CPU Scheduling 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Feng-Chia Unive ersity Outline Basic Concepts Scheduling Criteria Scheduling

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling 1.1 Maximum CPU utilization obtained with multiprogramming CPU I/O Burst

### The Nature of Program Executions

Processor Scheduling 1 The Nature of Program Executions A running thread can be modeled as alternating series of CPU bursts and I/O bursts during a CPU burst, a thread is executing instructions during

### Slides from Silberschatz, Galvin and Gagne 2003 Thu D. Nguyen Michael Hicks

Slides from Silberschatz, Galvin and Gagne 2003 Thu D. Nguyen Michael Hicks Basic Concepts CPU-I/O burst cycle - Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution

### Chapter 5: CPU Scheduling!

Chapter 5: CPU Scheduling Operating System Concepts 8 th Edition, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling

### Describe various CPU-scheduling algorithms. Describe various multi- processor CPU-scheduling algorithms

CPU Scheduling Objectives Describe various CPU-scheduling algorithms Describe various multi- processor CPU-scheduling algorithms To discuss evaluation criteria for selecting a CPUscheduling algorithm for

### CSC 271 Software I: Utilities and Internals

CSC 271 Software I: Utilities and Internals Lecture 9 : What are Processes? The Process Concept Originally, computers ran only one program at a time, which had total access to all of the computer s resources.

### CPU scheduling. CPU Scheduling. No.4. CPU burst vs. I/O burst. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University

EECS 3221 Operating System Fundamentals No.4 CPU scheduling Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University CPU Scheduling CPU scheduling is the basis of multiprogramming

### 5.1 Basic Concepts. Chapter 5: Process Scheduling. Alternating Sequence of CPU And I/O Bursts. 5.1 Basic Concepts

5.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution Chapter 5: Process

### Chapter 5: CPU Scheduling. Operating System Concepts with Java 8 th Edition

Chapter 5: CPU Scheduling 5.1 Silberschatz, Galvin and Gagne 2009 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process execution consists of a cycle of CPU

### Computer Systems II. CPU Scheduling. Review of Process States

Computer Systems II CPU Scheduling 1 Review of Process States 2 1 OS Queuing Model Enter Ready queue CPU Exit Disk Queue Network Queue Printer Queue Processes enter and leave the system 3 CPU Scheduling

### Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Edited by Ghada Ahmed, PhD ghada@fcih.net Silberschatz, Galvin and Gagne 2013 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process

### Chapter 5: CPU Scheduling!

Chapter 5: CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! Multiple-Processor Scheduling! Real-Time Scheduling! Algorithm Evaluation! 6.1! Basic Concepts! Long-term scheduler

### 4003-440/4003-713 Operating Systems I. Process Scheduling. Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu)

4003-440/4003-713 Operating Systems I Process Scheduling Warren R. Carithers (wrc@cs.rit.edu) Rob Duncan (rwd@cs.rit.edu) Review: Scheduling Policy Ideally, a scheduling policy should: Be: fair, predictable

### Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms Chapter 5: Process Scheduling To discuss evaluation criteria for selecting the CPUscheduling algorithm for a particular

### CPU Scheduling. CPU Scheduling

CPU Scheduling Electrical and Computer Engineering Stephen Kim (dskim@iupui.edu) ECE/IUPUI RTOS & APPS 1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

### Chapter 5: CPU Scheduling. Operating System Concepts 7 th Edition, Jan 14, 2005

Chapter 5: CPU Scheduling Operating System Concepts 7 th Edition, Jan 14, 2005 Silberschatz, Galvin and Gagne 2005 Outline Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

### The Nature of Program Executions

Processor Scheduling 1 The Nature of Program Executions A running thread can be modeled as alternating series of CPU bursts and I/O bursts during a CPU burst, a thread is executing instructions during

### Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Linux Example

### Agenda. CPU Scheduling. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times. Alternating Sequence of CPU And I/O Bursts

TDDB3: Concurrent programming and operating systems [SGG7] Chapter 5 Agenda CPU Scheduling Introduce CPU scheduling Describe various CPU scheduling algorithms Discuss evaluation criteria of CPU scheduling

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### Processor Scheduling. Background. Scheduling. Scheduling

Background Processor Scheduling The previous lecture introduced the basics of concurrency Processes and threads Definition, representation, management We now understand how a programmer can spawn concurrent

### Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

### CS 571 Operating Systems. CPU Scheduling. Angelos Stavrou, George Mason University

CS 571 Operating Systems CPU Scheduling Angelos Stavrou, George Mason University CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms First-Come-First-Served Shortest-Job-First, Shortest-remaining-Time-First

### Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition,

Chapter 6: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating

### Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

Announcements Reading Chapter 5 Chapter 7 (Monday or Wednesday) Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU execution and I/O wait. CPU burst distribution What are the

### CPU scheduling. Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times. CPU Scheduler

CPU scheduling Alternating Sequence of CPU And I/O Bursts Maximum CPU utilization is obtained by multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.

### CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms!

CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! First-Come-First-Served! Shortest-Job-First, Shortest-remaining-Time-First! Priority Scheduling! Round Robin! Multi-level Queue!

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### Objectives. 5.1 Basic Concepts. Scheduling Criteria. Multiple-Processor Scheduling. Algorithm Evaluation. Maximum CPU.

Chapter 5: Process Scheduling Objectives To introduce CPU scheduling To describe various CPU-scheduling algorithms To discuss evaluation criteria for selecting the CPU-scheduling algorithm for a particular

### COSC243 Part 2: Operating Systems

COSC243 Part 2: Operating Systems Lecture 17: CPU Scheduling Zhiyi Huang Dept. of Computer Science, University of Otago Zhiyi Huang (Otago) COSC243 Lecture 17 1 / 30 Overview Last lecture: Cooperating

### PROCESS SCHEDULING ALGORITHMS: A REVIEW

Volume No, Special Issue No., May ISSN (online): -7 PROCESS SCHEDULING ALGORITHMS: A REVIEW Ekta, Satinder Student, C.R. College of Education, Hisar, Haryana, (India) Assistant Professor (Extn.), Govt.

Scheduling Reading: Silberschatz chapter 6 Additional Reading: Stallings chapter 9 EEL 358 1 Outline Introduction Types of Scheduling Scheduling Criteria FCFS Scheduling Shortest-Job-First Scheduling Priority

### Escalonamento de Processos

Escalonamento de Processos SLIDES 6B Short-Term Scheduling Known as the dispatcher Executes most frequently Invoked when an event occurs Clock interrupts I/O interrupts Operating system calls Signals Scheduling

### Chapter 5: CPU Scheduling. Chapter 5: CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. CPU Scheduler

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d

Comp 204: Computer Systems and Their Implementation Lecture 12: Scheduling Algorithms cont d 1 Today Scheduling continued Multilevel queues Examples Thread scheduling 2 Question A starvation-free job-scheduling

### Lecture 5 Process Scheduling (chapter 5)

Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 5 Process Scheduling (chapter 5) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The slides

### Comparative Study of Different CPU Scheduling Algorithms

Available Online at www.ijcsmc.com International Journal of Computer Science and Mobile Computing A Monthly Journal of Computer Science and Information Technology IJCSMC, Vol. 2, Issue. 11, November 2013,

### Scheduling Criteria. response time/turnaround time: time required to finish a task

Processor Scheduling 1 Scheduling Criteria CPU utilization: keep the CPU as busy as possible throughput: rate at which tasks are completed response time/turnaround time: time required to finish a task

### CPU Scheduling Algorithms

CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those from the course text Operating Systems Concepts, 9th ed., by Silberschatz, Galvin, and Gagne. Many, if not

### ICS 143 - Principles of Operating Systems

ICS 143 - Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Note that some slides are adapted from course text slides 2008 Silberschatz. Some

### ANALYSIS AND REVIEW OF CPU SCHEDULING TECHNIQUES THROUGH COMPARATIVE STUDY

ANALYSIS AND REVIEW OF CPU SCHEDULING TECHNIQUES THROUGH COMPARATIVE STUDY Manish Vyas Sr. Assistant Professor, Department of Computer Science Acropolis Institute of Management Studies and Research, Indore

### ECE3055 Computer Architecture and Operating Systems

ECE3055 Computer Architecture and Operating Systems Lecture: CPU Scheduling Prof. Hsien-Hsin Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology H.-H. S. Lee 1 Overview

### Scheduling Criteria. A task might be a single CPU burst, a thread, or an applicationlevel service request. The Nature of Program Executions

Processor Scheduling 1 Scheduling Criteria CPU utilization: keep the CPU as busy as possible throughput: rate at which tasks are completed response time/turnaround time: time required to finish a task

### Chapter 5: CPU Scheduling. Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

### Announcements Project #2. Basic Concepts

Announcements Project #2 Is due at 6:00 PM on Friday Program #3 Posted tomorrow (implements scheduler) Reading Chapter 6 Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU

### Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm Evaluation Objectives To introduce

### Process boundness. Process scheduling. Alternating Sequence of CPU and I/O Bursts. Histogram of CPU-burst Times

Process scheduling slide 1 Process boundness slide 2 See Silberschatz Chapter 5 Processes can be described as either: I/O-bound process - spends more time doing I/O than computations, many short bursts