If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is _____________ milliseconds.
View worked solution
Answer: 3
We use the preemptive Shortest Remaining Time First (SRTF) scheduling algorithm. Let us trace the execution step-by-step using a Gantt chart:
Gantt Chart:
| P1 | P2 | P4 | P1 | P3 | |
| 0 | 3 | 6 | 8 | 12 | 17 |
Step-by-step Execution:
- At : Only is available. It runs for (remaining burst time of ).
- At : arrives with burst time . Since , preempts .
- At : arrives with burst time . The remaining burst time of is . Since , continues and finishes at .
- At : arrives with burst time . The available processes are (remaining ), (remaining ), and (remaining ). is scheduled and finishes at .
- At : Between (remaining ) and (remaining ), is scheduled and finishes at .
- At : is scheduled and finishes at .
Metrics Calculation:
Free practice · Your answers on this page are not saved.
