Performance Analysis of Scheduling Algorithms: FCFS, SJF, and RR

Verified

Added on  2019/09/21

|3
|251
|334
Homework Assignment
AI Summary
This assignment solution analyzes three scheduling algorithms: First-Come, First-Served (FCFS), Shortest Job First (SJF), and Round Robin. It calculates turnaround time, waiting time, and average waiting time for each algorithm. The solution includes calculations for each process under each scheduling method. The average waiting time is calculated for each algorithm to determine which results in the minimum average waiting time, with Shortest Remaining Time Next (SRNT) algorithm yielding the lowest average waiting time. The solution demonstrates the performance comparison of each algorithm to determine the most efficient approach.
Document Page
Ans a) Gantt charts
FCFS
SJF: same as above
SRNT:
ROUND ROBIN:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Ans b & c) Turnaround time and waiting time of each process for each scheduling
algorithm
Formulas:
Turnaround time is = completion time – arrival time
Waiting time = turnaround time – burst time
FCFS & SJF:
Process Turn Around Time Waiting Time
P1 10-0=10 10-10=0
P2 11-1=10 10-1=9
P3 13-2=11 11-2=9
P4 16-4=12 12-3=9
P5 20-8=12 12-4=8
35
SRNT:
Process Turn Around Time Waiting Time
P1 20-0=20 20-10=10
P2 2-1=1 1-1=0
P3 4-2=2 12-2=0
P4 7-4=3 3-3=0
P5 12-8=4 4-4=0
10
Document Page
ROUND ROBIN:
Process Turn Around Time Waiting Time
P1 20-0=20 20-10=10
P2 2-1=1 1-1=0
P3 5-2=3 3-2=1
P4 11-4=7 7-3=4
P5 17-8=9 9-4=5
Total 20
Ans d)
Average waiting time for each scheduling algorithm:
average waiting time = sum of all process waiting time/ total number of processes
FCFS:
average waiting time = sum of all process waiting time/ total number of processes
= (0+9+9+9+8) / 5 = 35 / 5 = 7
SJF: average writing time is same as FCFS and that is 7.
SRNT:
Average waiting time = (10+0+0+0+0) /5 = 2
ROUND ROBIN:
Average waiting time = (10+0+1+4+5)/5 = 20/5 = 4.
As we can see the minimum average time is of SRNT algorithm. So SRNT algorithm results in
the minimum average waiting time and that is 2.
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]