Consider three processes (process id , , respectively) with compute time bursts , and time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turn around time is:
View worked solution
Answer: A
Longest Remaining Time First (LRTF) is a preemptive scheduling algorithm. At any time instant, the process with the longest remaining burst time is scheduled. Ties are broken by choosing the process with the lowest process ID.
Let the processes be , , and with initial burst times , , and respectively, arriving at . We trace the execution step-by-step:
- Interval : has the longest remaining time (). It runs for units.
Remaining times at : , , . - Interval : and are tied at . runs (lower ID).
Remaining times at : , , . - Interval : runs.
Remaining times at : , , . - Interval : and are tied at . runs.
Remaining times at : , , . - Interval : runs.
Remaining times at : , , . - Interval : All are tied at . runs.
Remaining times at : , , . - Interval : and are tied at . runs.
Remaining times at : , , . - Interval : runs.
Remaining times at : , , . - Interval : All are tied at . runs and completes.
Remaining times at : , , . - Interval : and are tied at . runs and completes.
Remaining times at : , . - Interval : runs and completes.
The completion times () for the processes are:
Since all processes arrive at , the turnaround time () for each process is equal to its completion time.
Free practice · Your answers on this page are not saved.
