1.

Differentiate between preemptive and non-preemptive scheduling algorithms.

Answer»

 Following are the differences between preemptive and non-preemptive scheduling algorithms:

Preemptive SchedulingNon-Preemptive Scheduling
The CPU is assigned to the processes in preemptive scheduling for a limited timeIn non-preemptive scheduling, the CPU is allocated to the processes until they terminate or switch to the waiting state.
In Preemptive scheduling, when a higher priority task arrives, the executing process in preemptive scheduling is halted in the middle of its execution.In non-preemptive scheduling, the executing process is not disturbed in the middle of its execution and WAITS until it is completed.
The overhead of transitioning a process from the ready state to the running state, and vice versa, as well as maintaining the ready queue, EXISTS in Preemptive Scheduling.Non-preemptive scheduling, on the other hand, has no overhead of transitioning the process from running to ready state.
In the case of preemptive scheduling, if a high-priority process repeatedly APPEARS in the ready queue, the low-priority process will have to wait for a long time, and it may have to starve.If CPU is allotted to a process with a long BURST time in non-preemptive scheduling, processes with shorter burst times may be forced to starve.
Preemptive scheduling achieves flexibility by granting important processes access to the CPU as soon as they enter the ready queue, regardless of what task is already running.Non-preemptive scheduling is referred to as stiff because even if a CRUCIAL process joins the ready queue, the process's CPU is unaffected.
Preemptive Scheduling is cost associative because it must maintain the integrity of shared dataNon-Preemptive scheduling is not cost associative.


Discussion

No Comment Found