What is the difference between preemptive and non-preemptive scheduling?
Interview preparation resource from Gate Smashers.
In preemptive scheduling, the OS may interrupt a running task and give the CPU to another task. In non-preemptive scheduling, a task keeps the CPU until it finishes or blocks voluntarily.
Preemption improves responsiveness and lets high-priority or interactive work run quickly, but it causes more context switches and requires careful synchronization around shared data.
Non-preemptive scheduling is simpler and has lower switching complexity, but one long task can delay every task behind it. Round Robin and SRTF are common preemptive algorithms; FCFS and non-preemptive SJF are common non-preemptive examples.
Preemption improves responsiveness because a long-running task cannot keep the CPU indefinitely. Non-preemptive scheduling is simpler and can reduce switching overhead, but one slow or blocked task may delay others. Modern general-purpose systems therefore normally use preemptive scheduling.
