0% found this document useful (0 votes)
4 views4 pages

CPU Scheduling Algorithms Analysis

The document presents various scheduling algorithms including FCFS, SJF, SRTF, preemptive priority, and RR, detailing their respective schedules, waiting times (WT), turnaround times (TT), and average values (AVR). Each algorithm is illustrated with a specific sequence of process execution and calculations for WT and TT. The results highlight the efficiency and performance differences among the scheduling methods.

Uploaded by

Phan Tiến Huy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

CPU Scheduling Algorithms Analysis

The document presents various scheduling algorithms including FCFS, SJF, SRTF, preemptive priority, and RR, detailing their respective schedules, waiting times (WT), turnaround times (TT), and average values (AVR). Each algorithm is illustrated with a specific sequence of process execution and calculations for WT and TT. The results highlight the efficiency and performance differences among the scheduling methods.

Uploaded by

Phan Tiến Huy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Ex 2:

a/ FCFS:
schedule :
0 (p1) 10 (p2) 39 (p3) 42 (p4) 49 (p5) 61

WT TT
P1 10 – 10 = 0 10 – 0 =10
P2 37 -29 = 8 39 – 2 = 37
P3 39 – 3 = 36 42 -3 = 39
P4 44 -7 =37 49 -5 = 44
P5 55– 12 = 43 61 -6 =55
AVR 24.8 37

b/ SJF :
schedule:
0 (p1) 10 (p3) 13 (p4) 20 (p5) 32 ( p2 ) 61

WT TT
P1 10 –1 0 = 0 10 – 0 =10
P2 59-29 = 30 61 – 2 = 59
P3 10 – 3 = 7 13 -3 = 10
P4 15 -7 =8 20 -5 = 15
P5 26 – 12 = 14 32 -6 =26
AVR 11.8 24
c/ SRTF :
0 (p1) 3 (p3) 6 (p4) 13 (p1) 20 (p5) 32 (p2) 61

WT TT
P1 20 – 10 = 10 20 – 0 =20
P2 59 -29 = 30 61 – 2 = 59
P3 3–3=0 6 -3 = 3
P4 8 -7 =1 13 -5 = 8
P5 26 – 12 = 14 32 -6 =26
AVR 11 23.2

d/ preemtive priority:
schedule:
0 (p1) 2 (p2) 5 (p4) 6 (p5) 18 (p4) 24 (p2) 50 (p1) 58
( p3) 61

WT TT
P1 58 – 10 = 48 58 – 0 =58
P2 48 -29 = 19 50 – 2 = 48
P3 58 – 3 = 55 61 -3 = 58
P4 19 -7 =12 24 -5 = 19
P5 12 – 12 = 0 18 -6 =12
AVR 26.8 39

e/
schedule:
0 (p1) 10 (p5) 22 (p4) 29 (p2) 58 (p3)
61

WT TT
P1 10 – 10 = 0 10 – 0 =10
P2 56 -29 = 27 58 – 2 = 56
P3 58 – 3 = 55 61 -3 = 58
P4 24 -7 =17 29 -5 = 24
P5 16 – 12 = 4 22 -6 =16
AVR 26.8 39

f/ RR:
schedule:
0 (p1) 10 p(2) 20 (p3) 23 (p4) 30 (p5) 40
(p2) 50 (p5) 52 (p6) 61
WT TT
P1 10 – 10 = 0 10 – 0 =10
P2 59 -29 = 30 61 – 2 = 59
P3 20 – 3 = 17 23 - 3 = 20
P4 25 -7 =18 30 -5 = 25
P5 46 – 12 = 34 52-6 =46
AVR 19.8 32

EX 3:

Schedule:
0 (p1) 5 (p2) 10 (p4) 15 (p3) 18 (p5) 23 (p1) 28 (p2) 33 (p4) 35 (p5)
40 (p2) 45 (p5) 47 (p2) 52 (p2) 57 (p2) 61

WT TT
P1 28 – 10 = 18 28 – 0 =28
P2 59 -29 = 30 61 – 2 = 59
P3 15 – 3 = 12 18 - 3 = 15
P4 30 -7 = 23 35 -5 = 30
P5 41 – 12 = 29 47-6 =41
AVR 22.4 34.6
EX 4:

P1 p2
R4 p3
0 4 8 9 13
19 24
R6 30

P1 p2 p1
p3 P2 p1 p3
FCFS

P3->P1->P2 30 32 33
36

WT TT
P1 33 – 11 = 22 33 – 0 =33
P2 29 -12 = 17 32 – 3 = 29
P3 27 – 13 = 14 36 - 9 = 27
P4 17.67 29.67

You might also like