CHAPTER 2 PROCESSOR SCHEDULING PART II

Slides:



Advertisements
Similar presentations
CHAPTER 2 PROCESSOR SCHEDULING PART I By U ğ ur HALICI.
Advertisements

Chapter 6: CPU Scheduling
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
CHAPTER 2 PROCESSOR SCHEDULING PART V by U ğ ur HALICI.
The act of Scheduling a process means changing the active PCB pointed to by the CPU. Also called a context switch. A context switch is essentially the.
CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize.
Scanf n, a, b /* I-O wait */ for (i=1; i
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: Process Scheduling.
Process Control Management
Scheduling.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CPU Scheduling CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
OPERATING SYSTEMS CS 3502 Fall 2017
lecture 5: CPU Scheduling
Copyright ©: Nahrstedt, Angrave, Abdelzaher
CPU Scheduling CSSE 332 Operating Systems
CPU SCHEDULING.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
CHAPTER 2 PROCESSOR SCHEDULING PART III
Chapter 3: Process-Concept
CPU Scheduling Chapter 5.
CPU scheduling 6. Schedulers, CPU Scheduling 6.1. Schedulers
Process Scheduling B.Ramamurthy 9/16/2018.
CPU Scheduling.
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Process management Information maintained by OS for process management
ICS 143 Principles of Operating Systems
CPU Scheduling Basic Concepts Scheduling Criteria
Process Management with OS
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Lecture 21: Introduction to Process Scheduling
Operating System Concepts
So far…. Firmware identifies hardware devices present
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
Operating systems Process scheduling.
COT 4600 Operating Systems Spring 2011
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU SCHEDULING.
CPU scheduling decisions may take place when a process:
Chapter 5: CPU Scheduling
CGS 3763 Operating Systems Concepts Spring 2013
Chapter 5: CPU Scheduling
Quiz.
Process Scheduling B.Ramamurthy 2/23/2019.
Process Scheduling B.Ramamurthy 2/23/2019.
Lecture 21: Introduction to Process Scheduling
Processor Scheduling Hank Levy 1.
Process Scheduling B.Ramamurthy 4/19/2019.
Process Scheduling B.Ramamurthy 4/24/2019.
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Concurrency and Threading: CPU Scheduling
Module 5: CPU Scheduling
Process Scheduling B.Ramamurthy 5/7/2019.
CPU SCHEDULING CPU SCHEDULING.
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
CPU Scheduling: Basic Concepts
Scheduling 21 May 2019.
CPU Scheduling ( Basic Concepts)
Chapter 6: CPU Scheduling
CPU Scheduling.
CPU Scheduling: Basic Concepts
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
CPU Scheduling CSE 2431: Introduction to Operating Systems
Presentation transcript:

CHAPTER 2 PROCESSOR SCHEDULING PART II by Ugur HALICI

2.5 Processor Scheduling algorithms The goal of a scheduling algorithm is to select the most appropriate process in the ready queue. For simplicity, we will assume that we have a single I/O server and a single device queue, device queue always implemented with FCFS (FIFO) method. We also will neglect the switching time between processes (context switching).

2.5 Processor Scheduling algorithms We will consider the following processes and will apply different scheduling algorithms on it. Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7

2.3.1 First-Come-First-Served (FCFS) In this algorithm, the process to be selected is the process which requests the processor first. This is the process whose PCB is at the head of the ready queue. Contrary to its simplicity, its performance may often be poor compared to other algorithms.

2.3.1 First-Come-First-Served (FCFS) FCFS may cause processes with short processor bursts to wait for a long time. If one process with a long processor burst gets the processor, all the others will wait for it to release it and the ready queue will be crowded. This is called the convoy effect.

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: A

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: B

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: B C

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: B C

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: C D

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: C D A

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: C D A

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: D A B

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: D A B

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: A B C

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: B C D

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: B C D

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: C D A

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: C D A

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: D A

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: A

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: D

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ: D

2.3.1 First-Come-First-Served (FCFS) Process Arrival time 1st exec 1st I/O 2nd exec 2nd I/O 3rd exec A 4 B 2 8 1 - C 3 D 7 RQ:

2.3.1 First-Come-First-Served (FCFS) Processor utilization = (35 / 35) * 100 = 100 % Throughput = 4 / 35=0.11

2.3.1 First-Come-First-Served (FCFS) Turn around time: tatA = 34 – 0 = 34 tatB = 27 – 2 = 25 tatC = 29 – 3 = 26 tatD = 35 – 7 = 28  tatAVG = (34 + 25 + 26 + 28) / 4 = 28.25

2.3.1 First-Come-First-Served (FCFS) Turn around time: tatA = 34 – 0 = 34 tatB = 27 – 2 = 25 tatC = 29 – 3 = 26 tatD = 35 – 7 = 28  tatAVG = (34 + 25 + 26 + 28) / 4 = 28.25

2.3.1 First-Come-First-Served (FCFS) Turn around time: tatA = 34 – 0 = 34 tatB = 27 – 2 = 25 tatC = 29 – 3 = 26 tatD = 35 – 7 = 28  tatAVG = (34 + 25 + 26 + 28) / 4 = 28.25

2.3.1 First-Come-First-Served (FCFS) Turn around time: tatA = 34 – 0 = 34 tatB = 27 – 2 = 25 tatC = 29 – 3 = 26 tatD = 35 – 7 = 28  tatAVG = (34 + 25 + 26 + 28) / 4 = 28.25

2.3.1 First-Come-First-Served (FCFS) Turn around time: tatA = 34 – 0 = 34 tatB = 27 – 2 = 25 tatC = 29 – 3 = 26 tatD = 35 – 7 = 28  tatAVG = (34 + 25 + 26 + 28) / 4 = 28.25

2.3.1 First-Come-First-Served (FCFS) Waiting time: wtA = (0 – 0) + (15 – 8) + (30 – 23) = 14 wtB = (4 – 2) + (19 – 13) = 8 wtC = (12 – 3) + (27 – 15) = 21 wtD = (14 – 7) + (29 – 16) + (34 – 31) = 23   wtAVG = (14 + 12 + 21 + 23) / 4 = 16.5

2.3.1 First-Come-First-Served (FCFS) Waiting time: wtA = (0 – 0) + (15 – 8) + (30 – 23) = 14 wtB = (4 – 2) + (19 – 13) = 8 wtC = (12 – 3) + (27 – 15) = 21 wtD = (14 – 7) + (29 – 16) + (34 – 31) = 23   wtAVG = (14 + 12 + 21 + 23) / 4 = 16.5

2.3.1 First-Come-First-Served (FCFS) Waiting time: wtA = (0 – 0) + (15 – 8) + (30 – 23) = 14 wtB = (4 – 2) + (19 – 13) = 8 wtC = (12 – 3) + (27 – 15) = 21 wtD = (14 – 7) + (29 – 16) + (34 – 31) = 23   wtAVG = (14 + 12 + 21 + 23) / 4 = 16.5

2.3.1 First-Come-First-Served (FCFS) Waiting time: wtA = (0 – 0) + (15 – 8) + (30 – 23) = 14 wtB = (4 – 2) + (19 – 13) = 8 wtC = (12 – 3) + (27 – 15) = 21 wtD = (14 – 7) + (29 – 16) + (34 – 31) = 23   wtAVG = (14 + 12 + 21 + 23) / 4 = 16.5

2.3.1 First-Come-First-Served (FCFS) Waiting time: wtA = (0 – 0) + (15 – 8) + (30 – 23) = 14 wtB = (4 – 2) + (19 – 13) = 8 wtC = (12 – 3) + (27 – 15) = 21 wtD = (14 – 7) + (29 – 16) + (34 – 31) = 23   wtAVG = (14 + 12 + 21 + 23) / 4 = 16.5

2.3.1 First-Come-First-Served (FCFS) Response time: rtA = 0 – 0 = 0 rtB = 4 – 2 = 2 rtC = 12 – 3 = 9 rtD = 14 – 7 = 7 rtAVG = (0 + 2 + 9 + 7) / 4 = 4.5

2.3.1 First-Come-First-Served (FCFS) Response time: rtA = 0 – 0 = 0 rtB = 4 – 2 = 2 rtC = 12 – 3 = 9 rtD = 14 – 7 = 7 rtAVG = (0 + 2 + 9 + 7) / 4 = 4.5

2.3.1 First-Come-First-Served (FCFS) Response time: rtA = 0 – 0 = 0 rtB = 4 – 2 = 2 rtC = 12 – 3 = 9 rtD = 14 – 7 = 7 rtAVG = (0 + 2 + 9 + 7) / 4 = 4.5

2.3.1 First-Come-First-Served (FCFS) Response time: rtA = 0 – 0 = 0 rtB = 4 – 2 = 2 rtC = 12 – 3 = 9 rtD = 14 – 7 = 7 rtAVG = (0 + 2 + 9 + 7) / 4 = 4.5

2.3.1 First-Come-First-Served (FCFS) Response time: rtA = 0 – 0 = 0 rtB = 4 – 2 = 2 rtC = 12 – 3 = 9 rtD = 14 – 7 = 7 rtAVG = (0 + 2 + 9 + 7) / 4 = 4.5