Preemptive Scheduling vs Non Preemptive Scheduling

Difference between Preemptive and Non preemptive scheduling

On this page, we will learn the concepts of preemptive scheduling and non preemptive scheduling and also get to now about the difference between preemptive vs non preemptive scheduling.

difference between scheduler and dispatcher

Preemptive Scheduling vs Non Preemptive Scheduling

The process manager in an operating system is responsible for process scheduling. It is an operating system activity in which a running process is removed from the CPU and is replaced by another high priority process following certain set of rules. Process scheduling is an important part of a multi programming system where multiple processes need execution. The process of scheduling can be categorised into two, Pre-emptive and non-pre-emptive scheduling.

Preemptive scheduling vs Non preemptive scheduling

Pre-emptive Scheduling

Scheduling in which a process is switched from the running state to the ready state and from the waiting state to the ready state. In this concept, the CPU is allocated to the process for a limited time and is again taken back when its time is over. The current state of the program is saved and is resumed again when the process is assigned to the CPU.  

 

Non Pre-emptive Scheduling

In this case, once the process is allocated the CPU, it is only released when the processing is over. The states into which a process switches are the running state to the waiting state. It is an approach in which a process is not interrupted when it is under process by the CPU.

Learn more about Non preemptive scheduling through Shortest Job First Scheduling (SJF) algorithm here.

Key Differences

Pre-emptive SchedulingNon- pre-emptive Scheduling
CPU allocation is for a limited time.CPU allocation until the process is complete.
Execution of the process is interrupted in the middle.Execution of the process remains uninterrupted until it is completed.
The concept bears an overhead of switching between the tasks.No such overhead of switching between the tasks.
If the CPU receives continuous high priority tasks, a process may remain in the waiting state indefinitely. If the CPU is processing a program with the largest burst time, even a program with the smallest burst time may have to starve.
It allows flexibility to the processes which are in the waiting state allowing the high priority tasks to be executed first. This approach is also known as the rigid scheduling as it offers no flexibility to the processes irrespective of their urgency for execution.
Pre emptive scheduling needs to maintain the integrity of the shared data and to ensure no data loss occurs when processes are swapped from the waiting state to the ready state.The Non- pre-emptive Scheduling does not require to maintain data integrity as no processes are swapped from the waiting state to the ready state.

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription