Difference between Preemative and non-Preemative in OS
Github (Follow me) and Click it for more things
Difference Between Preemptive and Non-Preemptive Scheduling in OS
It is the responsibility of CPU scheduler to allot a process to CPU whenever the CPU is in the idle state. The CPU scheduler selects a process from ready queue and allocates the process to CPU. The scheduling which takes place when a process switches from running state to ready state or from waiting state to ready state is called Preemptive Scheduling.
On the other hand, the scheduling which takes place when a process terminates or switches from running to waiting for state this kind of CPU scheduling is called Non-Preemptive Scheduling.
The basic difference between preemptive and non-preemptive scheduling lies in their name itself. That is a Preemptive scheduling can be preempted; the processes can be scheduled. In Non-preemptive scheduling, the processes can not be scheduled.
Let us discuss the differences between the both Preemptive and Non-Preemptive Scheduling in brief with the help of comparison chart shown below.
Content: Preemptive Vs Non-Preemptive Scheduling
Comparison Chart
BASIS FOR COMPARISON | PREEMPTIVE SCHEDULING | NON PREEMPTIVE SCHEDULING |
---|---|---|
Basic | The resources are allocated to a process for a limited time. | Once resources are allocated to a process, the process holds it till it completes its burst time or switches to waiting state. |
Interrupt | Process can be interrupted in between. | Process can not be interrupted till it terminates or switches to waiting state. |
Starvation | If a high priority process frequently arrives in the ready queue, low priority process may starve. | If a process with long burst time is running CPU, then another process with less CPU burst time may starve. |
Overhead | Preemptive scheduling has overheads of scheduling the processes. | Non-preemptive scheduling does not have overheads. |
Flexibility | Preemptive scheduling is flexible. | Non-preemptive scheduling is rigid. |
Cost | Preemptive scheduling is cost associated. | Non-preemptive scheduling is not cost associative. |
Comments
Post a Comment