Difference Between Preemptive and Non-Preemptive Scheduling in OS


In Operating Systems, Preemptive Scheduling is a type of CPU scheduling method in which the CPU is allocated for a limited time to a given process. In contrast, Non-Preemptive Scheduling is the scheduling technique in which the CPU is allocated to a process and hold by it till the process gets terminated.

Read this article to learn more about Preemptive and Non-Preemptive Scheduling in Operating System and how they are different from each other.

What is Preemptive Scheduling?

Preemptive Scheduling is a type of CPU scheduling in which the resources (CPU Cycle) have been allocated to a process for a limited amount of time. In this type of scheduling, a process can be interrupted when it is being executed.

In preemptive scheduling, if a process that has a high priority arrives frequently in the 'ready' queue, the low priority processes may starve. Also, this kind of scheduling has overheads since it has to schedule multiple processes. Hence, the preemptive scheduling is flexible in nature.

Preemptive scheduling is an expensive scheduling technique. It has high CPU utilization. Examples of preemptive scheduling include Round Robin scheduling, Shortest Remaining Time First scheduling, etc.

What is Non-Preemptive Scheduling?

Non-Preemptive Scheduling is one in which once the resources (CPU Cycle) have been allocated to a process, the process holds it until it completes its burst time or switches to the 'wait' state.

In non-preemptive scheduling, a process cannot be interrupted until it terminates itself or its time is over. If a process that has a long burst time is running the CPU, then the process that has less CPU burst time would starve.

Non-preemptive scheduling is not flexible in nature, also it is not expensive. Examples of non-pre-emptive scheduling include First Come First Serve and Shortest Job First.

Now, let us discuss the difference between preemptive and non-preemptive scheduling in detail.

Difference between Preemptive Scheduling and Non-Preemptive Scheduling

The following table highlights all the important differences between preemptive scheduling and non-preemptive scheduling −

S.No.

Preemptive Scheduling

Non-Preemptive Scheduling

1.

The CPU scheduling in which the resources (CPU Cycle) have been allocated to a process for a limited amount of time is known as preemptive scheduling.

The type of scheduling in which once the resources (CPU Cycle) have been allocated to a process, the process holds it until it completes its burst time or switches to the 'wait' state is known as non-preemptive scheduling.

2.

In the preemptive scheduling, a process can be interrupted when it is being executed.

In the non-preemptive scheduling, a process cannot be interrupted until it terminates itself or its time is over.

3.

If a process that has a high priority arrives frequently in the 'ready' queue, the low priority processes may starve.

If a process that has a long burst time is running the CPU, then the process that has less CPU burst time would starve

4.

It has overheads.

It does not have overheads.

5.

It is flexible in nature.

It is not flexible in nature.

6.

It is expensive.

It is not expensive.

7.

Examples − Round Robin scheduling, Shortest Remaining Time First scheduling.

Examples − First Come First Serve and Shortest Job First.

Conclusion

The most significant difference between the two is that Preemptive scheduling works by dividing the time slots of CPU to a given process, while Non-preemptive scheduling takes the CPU and holds it till the process gets terminated or is pushed to the waiting state.

Updated on: 21-Feb-2023

17K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements