Which of the following best distinguishes Shortest Job First (SJF) from…
2025
Which of the following best distinguishes Shortest Job First (SJF) from Shortest Remaining Time First (SRTF) scheduling?
- A.
SJF is non-preemptive, while SRTF supports preemption when a shorter process arrives.
- B.
SJF allows preemption, while SRTF does not.
- C.
SJF is used in real-time systems, whereas SRTF is used in batch systems.
- D.
Both SJF and SRTF operate identically in all CPU scheduling environments.
Attempted by 101 students.
Show answer & explanation
Correct answer: A
Shortest Job First (SJF) and Shortest Remaining Time First (SRTF) are both CPU scheduling algorithms designed to minimize average waiting time by prioritizing processes with the shortest burst times. The fundamental distinction lies in how they handle process execution once started.
SJF is inherently non-preemptive, meaning that once a process begins executing on the CPU, it runs to completion without interruption. Even if a new process arrives with a shorter burst time, the currently running process continues until it finishes.
In contrast, SRTF is the preemptive version of SJF. It continuously monitors the ready queue and allows a newly arrived process with a shorter remaining burst time to preempt (interrupt) the currently running process. This ensures that the CPU is always working on the task expected to finish soonest.