1. Shortest Job First (SJF) :
The Shortest Job First (SJF) is a scheduling policy that selects the waiting process with the smallest execution time to execute next. It is also known as Shortest Job Next (SJN) or Shortest Process Next (SPN). It a preemptive scheduling algorithm.
2. Shortest Remaining Job First (SRTF) :
The Shortest Remaining Job First (SRJF) is the preemptive version of SJF scheduling. In this scheduling algorithm, the process with the smallest amount of time remaining until completion is selected to execute. Processes having same arrival time will convert SRTF to SJF.
- Both SJF and SRJF are practically not feasible as it is not possible to predict the burst time of the processes.
- Both SJF and SRJF may lead to process starvation as long processes may be held off indefinitely if short processes are continually added.
- Both SJF and SRJF are considered same once all the processes are available in the ready queue. This is because after the processes are added in the ready queue, no preemption is carried out.
|Shortest Job First:||Shortest Remaining Job First:|
|It is a non-preemptive algorithm.||It is a preemptive algorithm.|
|It involves less overheads than SRJF.||It involves more overheads than SJF.|
|It is slower in execution than SRJF.||It is faster in execution than SJF.|
|It leads to comparatively lower throughput.||It leads to increased throughput as execution time is less.|
|It minimizes the average waiting time for each process.||It may or may not minimize the average waiting time for each process.|
|It may suffer from priority inversion.||It may suffer from convoy effect.|
|It involves lesser number of context switching.||It involves higher number of context switching.|
|Short processes are executed first and then followed by longer processes.||Shorter processes run fast and longer processes show poor response time.|
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between SRJF and LRJF CPU scheduling algorithms
- Difference between SJF and LJF CPU scheduling algorithms
- Difference between EDF and LST CPU scheduling algorithms
- Difference between FCFS and SJF CPU scheduling algorithms
- Difference between LOOK and C-LOOK Disk scheduling algorithms
- Difference between SCAN and LOOK Disk scheduling algorithms
- Difference between Longest Job First (LJF) and Round Robin (RR) scheduling algorithms
- Difference between FCFS and SCAN disk scheduling algorithms
- Difference between Shortest Job First (SJF) and Round-Robin (RR) scheduling algorithms
- Difference between First Come First Served (FCFS) and Longest Job First (LJF) CPU scheduling algorithms
- Difference between SCAN and CSCAN Disk scheduling algorithms
- Difference between Multi Level Queue (MLQ) Scheduling and Round Robin (RR) algorithms
- Difference between Multi Level Queue Scheduling (MLQ) and Priority Scheduling
- Difference between Priority Scheduling and Round Robin (RR) CPU scheduling
- Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
- Difference between Preemptive and Non-preemptive CPU scheduling algorithms
- Disk Scheduling Algorithms
- FCFS Disk Scheduling Algorithms
- Advantages and Disadvantages of various CPU scheduling algorithms
- SCAN (Elevator) Disk Scheduling Algorithms
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.