Which of the following scheduling algorithms can work in both preemptive and non-preemptive modes?
Explanation
CPU scheduling algorithms are classified by whether they allow the operating system to interrupt a currently running process (preemptive) or require the process to finish its CPU burst before the scheduler selects a new one (non-preemptive).
SJF (Shortest Job First): Can be implemented as non-preemptive (standard SJF) or preemptive (SRTF).
Priority Scheduling: Can be implemented as non-preemptive (a process finishes its burst) or preemptive (a new process with a higher priority arrives and preempts the current process).
FCFS: Is inherently non-preemptive.
Round Robin: Is inherently preemptive (based on time slices/quantums).
To represent this mathematically regarding scheduling modes:
Mode∈{Preemptive,Non-preemptive}
Algorithm Capability={A∣A supports Preemptive∩A supports Non-preemptive}
Therefore:
{SJF, Priority Scheduling}⊆Algorithm Capability