Question
Processes arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times.
Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?
Official answer and solution
- Official answer
- D
- From
- Official GATE 2025 answer key
Solution
Construct the Gantt chart for SRTF scheduling, compute each process's completion time and turnaround time (), and take the average.
Tracing the SRTF schedule:
- to : runs ( remaining). At , arrives with burst , so continues.
- to : runs ( remaining). At , arrives with burst and preempts .
- to : runs to completion at . At , arrives with burst .
- to : Remaining times are . runs to completion at .
- to : () runs to completion at .
- to : () runs to completion at .
| Process | Arrival Time (AT) | Burst Time (BT) | Completion Time (CT) | Turnaround Time (TAT = CT - AT) |
|---|---|---|---|---|
| 0 | 10 | 16 | 16 | |
| 1 | 13 | 38 | 37 | |
| 2 | 6 | 8 | 6 | |
| 8 | 9 | 25 | 17 |
Average turnaround time .
Option (D)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 26 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.