LONGEST REMAINING JOB FIRST
L.R.J.F.
Basic Theory :
It is the preemptive version of Longest Job First CPU Scheduling
algorithm.
The process Burst Time are chosen at every second and then the longest job is selected. In case, the Burst Time of the processes are same, the job with overall low arrival time is selected. It suffers from starvation, because of simultaneous checking of processes’ remaining Burst Time. It is also called “Longest Remaining Time First” algorithm.
The process Burst Time are chosen at every second and then the longest job is selected. In case, the Burst Time of the processes are same, the job with overall low arrival time is selected. It suffers from starvation, because of simultaneous checking of processes’ remaining Burst Time. It is also called “Longest Remaining Time First” algorithm.
- First, sort the processes in increasing order of their Arrival Time.
- Choose the process having least arrival time but with most Burst Time. Then process it for 1 unit. Check if any other process arrives upto that time of execution or not.
- Repeat the above both steps until execute all the processes.