Preemptive and Non preemptive Scheduling Operating Systems

For Complete YouTube Video: Click Here

This class will try to understand Preemptive and Non preemptive Scheduling Operating Systems.

Our previous class discussed the concept of IO and CPU-bound processes.

Preemptive and Non preemptive Scheduling Operating Systems

Preemptive Scheduling Operating Systems: The resources (CPU Cycles) are allocated to the process for a limited time and then taken away.  

Non preemptive Operating System: In this scheduling, once the resources (CPU Cycles) are allocated to a process, the process holds the CPU till it gets terminated or requests an IO operation.

To understand this concept, we will consider the image shown below.

In the above image, we have two processes, P1 and P2.

For example, if P1 is on the CPU on a preemptive scheduled operating system, the process will use the CPU only for a specific period. After that, another process will be allocated to the CPU. 

Similarly, if P2 is on Non preemptive scheduled operating system, the process will use the CPU until there is an instruction for an IO operation. If there is no instruction for IO operation, then all the instructions will be executed, and the process will be terminated.

The preemptive scheduled operating are called multitasking operating systems, and the non-preemptive operating systems are multiprogramming operating systems.