Operating System

Describe shortest- remaining-time-first (SRTF) CPU scheduling ?

Shortest remaining time first (SRTF) is a CPU scheduling algorithm. It is a preemptive version of the shortest job first (SJF) scheduling algorithm. In SRTF, the process with the least burst time remaining is executed first. SRTF is used in batch systems where it is desirable to give preference to short jobs.

the SRTF algorithm involves more overheads than the Shortest job first (SJF)scheduling, because in SRTF OS is required frequently in order to monitor the CPU time of the jobs in the READY queue and to perform context switching.

SRTF has the following advantages:

  • Quick execution: Processes with a shorter burst time are executed quickly.
  • Minimal system overhead: The system only needs to make a choice when a process completes its execution, or a new process is added to the queue.

However, SRTF also has the following disadvantages:

  • It can not be implemented practically since burst time of the processes can not be known in advance.
  • It leads to starvation for processes with larger burst time.
  • Priorities can not be set for the processes.
  • Processes with larger burst time have poor response time.

Overall, SRTF is a CPU scheduling algorithm that can be used to improve the performance of batch systems. However, it is important to be aware of the disadvantages of SRTF before using it in a production environment.

Example

In this Example, there are five jobs P1, P2, P3, P4, P5 and P6. Their arrival time and burst time are given below in the table.

Process IDArrival TimeBurst TimeCompletion TimeTurn Around TimeWaiting TimeResponse Time
1082020120
21410951
3224202
4315214
543139610
6527205
os srtf scheduling algorithm

                    Avg Waiting Time = 24/6

Leave a Reply

Your email address will not be published. Required fields are marked *