Consider the list of processes in the following table Process A
![Consider the list of processes in the following table
Process
A](/img/relate-questions.png)
Consider the list of processes in the following table
Process |
Arrival Time |
Processing Time |
A |
0 |
3 |
B |
1 |
6 |
C |
4 |
4 |
D |
6 |
2 |
Which of the following scheduling schemes is/are correct?
Time Quantum = 2 unit
NOTE:
SJF → Shortest Job First (Non preemptive), SRTF → Shortest Remaining time First
FCFS → First Come First Serve, RR → RoundRobin
A. Turnaround time of SRTF is less than SJF
B. Turnaround time of RR is less than FCFS
C. Turnaround time of SRTF is equal to FCFS
D. Turnaround time of RR is greater than FCFS
Please scroll down to see the correct answer and solution guide.
Right Answer is:
SOLUTION
Scheduling Algorithm:
First come first serve
Gantt chart:
A |
B |
C |
D |
0 3 9 13 15
Process Table:
Process |
Arrival Time |
Processing Time |
Completion time |
Turnaround time |
A |
0 |
3 |
3 |
3 |
B |
1 |
6 |
9 |
8 |
C |
4 |
4 |
13 |
9 |
D |
6 |
2 |
15 |
9 |
Average turnaround time = 29/4 = 7.25
Scheduling Algorithm:
Non pre-emptive shortest job first
Gantt chart:
A |
B |
D |
C |
0 3 9 11 15
Process Table:
Process |
Arrival Time |
Processing Time |
Completion time |
Turnaround time |
A |
0 |
3 |
3 |
3 |
B |
1 |
6 |
9 |
8 |
C |
4 |
4 |
15 |
11 |
D |
6 |
2 |
11 |
5 |
Average turnaround time = 27/4 = 6.75
Scheduling Algorithm:
Shortest remaining time first
Gantt chart:
A |
B |
C |
D |
B |
0 3 4 8 10 15
Process Table:
Process |
Arrival Time |
Processing Time |
Completion time |
Turn around time |
A |
0 |
3 |
3 |
3 |
B |
1 |
6 |
15 |
14 |
C |
4 |
4 |
8 |
4 |
D |
6 |
2 |
10 |
4 |
Average turnaround time = 25/4 = 6.25
Turnaround time of SRTF is less than SJF
Therefore option 1 is correct.
Scheduling Algorithm:
Round Robin with Quantum value two
Gantt chart:
A |
B |
A |
C |
B |
D |
C |
B |
0 2 4 5 7 9 11 13 15
Process Table:
Process |
Arrival Time |
Processing Time |
Completion time |
Turnaround time |
A |
0 |
3 |
5 |
5 |
B |
1 |
6 |
15 |
14 |
C |
4 |
4 |
13 |
9 |
D |
6 |
2 |
11 |
5 |
Average turnaround time = 33/4 = 8.25
Therefore, the Turnaround time of RR is greater than FCFS true
Therefore option 4 is correct.