Download presentation
Presentation is loading. Please wait.
Published byΣαναχάριβος Ζέφυρος Λούλης Modified over 6 years ago
1
CHAPTER 2 PROCESSOR SCHEDULING PART II
by Ugur HALICI
2
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).
3
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
4
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.
5
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.
6
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
7
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
8
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
9
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
10
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
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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
20
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
21
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
22
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
23
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
24
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:
25
2.3.1 First-Come-First-Served (FCFS)
Processor utilization = (35 / 35) * 100 = 100 % Throughput = 4 / 35=0.11
26
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 = ( ) / 4 = 28.25
27
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 = ( ) / 4 = 28.25
28
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 = ( ) / 4 = 28.25
29
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 = ( ) / 4 = 28.25
30
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 = ( ) / 4 = 28.25
31
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 = ( ) / 4 = 16.5
32
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 = ( ) / 4 = 16.5
33
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 = ( ) / 4 = 16.5
34
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 = ( ) / 4 = 16.5
35
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 = ( ) / 4 = 16.5
36
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 = ( ) / 4 = 4.5
37
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 = ( ) / 4 = 4.5
38
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 = ( ) / 4 = 4.5
39
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 = ( ) / 4 = 4.5
40
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 = ( ) / 4 = 4.5
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.