Final answer:
Preemptive scheduling allows processes to be interrupted for higher priority tasks, whereas non-preemptive scheduling does not. Examples of preemptive scheduling include Round Robin and Priority Scheduling, while examples of non-preemptive scheduling include First Come First Served and Shortest Job Next.
Step-by-step explanation:
The difference between preemptive and non-preemptive scheduling lies in how they handle process execution in an operating system's CPU scheduling. Preemptive scheduling allows a process to be interrupted in the midst of its execution and then returned to the queue if a higher priority process arrives. On the other hand, non-preemptive scheduling mandates that a process must finish its CPU burst time before another process can take over.
Examples of preemptive scheduling include:
- Round Robin (RR): Processes are assigned time slots (quantum) and are interrupted if they do not complete within that time, allowing other processes a turn.
- Priority Scheduling: If a process with a higher priority comes in, the current process is preempted and the higher-priority process is executed first.
Examples of non-preemptive scheduling include:
- First Come First Served (FCFS): Processes are executed in the order they arrive, with no interruptions allowed, regardless of their priority.
- Shortest Job Next (SJN): The process with the shortest execution time is chosen next, and once it starts, it runs to completion without preemption.