Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

Difference between LJF and LRJF CPU scheduling algorithms

  • Last Updated : 17 Jul, 2020

1. Longest Job First (LJF) :
It CPU Scheduling algorithm where the process with the largest burst line is executed first. Once the process enters the ready queue, the process exits only after the completion of execution, therefore it is a non-preemptive process. In case, the burst times of the processes are same, the job with overall lowest time is selected. This CPU scheduling algorithm results in low throughput of the system.

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

ProcessATBT
103
212
324
435
546





2. Longest Remaining Job First (LRJF) :
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.

ProcessATBT
103
212
324
435
546



Difference between LJF and LRJF CPU scheduling algorithms :

LJFLRJF
Non preemptivePreemptive
It suffers from starvationIt also suffers from starvation
Waiting Time is highWaiting Time is not so high, and processes get chances for execution after some interval.
Switching context is less, since a process that once enters running state is executed completely.Switching context is more, since the process are continually checked for execution.
The processes are executed based on their CPU time and arrival time alone, without increasing CPU overload.The processes are repeatedly checking for an idle CPU, thereby increasing the overload.
No process can complete its execution until longest job persists.The processes can complete execution before the longest process.

My Personal Notes arrow_drop_up
Recommended Articles
Page :