In which of the following scheduling criteria, context switching will never…
2018
In which of the following scheduling criteria, context switching will never take place ?
- A.
ROUND ROBIN
- B.
Preemptive SJF
- C.
Non-preemptive SJF
- D.
Preemptive priority
Attempted by 549 students.
Show answer & explanation
Correct answer: C
Correct answer: Non-preemptive SJF
Why this is correct: Non-preemptive SJF does not interrupt a running process due to the arrival of another process. Once a process gets the CPU it runs until it finishes or blocks, so the scheduler does not perform preemption-based context switches.
Non-preemptive SJF: the running process is not preempted by newly arriving jobs; no preemption-based context switches occur during its execution.
Round Robin: uses a fixed time quantum and forcibly preempts the running process at the end of each quantum, causing frequent context switches.
Preemptive SJF: can preempt the current process if a newly arrived job has a shorter remaining time, leading to context switches.
Preemptive priority: a higher-priority arrival can preempt the running process, producing context switches.
Note: Although non-preemptive SJF avoids context switches caused by preemption, a context switch still occurs when the running process terminates or blocks and the scheduler selects the next process. The question is asking about absence of preemption-related context switching, which is why non-preemptive SJF is the intended answer.
A video solution is available for this question — log in and enroll to watch it.