What do you mean by non-preemptive and preemptive scheduling algorithm?
Answers
Key Differences Between Preemptive and Non-Preemptive Scheduling
The basic difference between preemptive and non-preemptive scheduling is that in preemptive scheduling the CPU is allocated to the processes for the limited time. While in Non-preemptive scheduling, the CPU is allocated to the process till it terminates or switches to waiting state.
The executing process in preemptive scheduling is interrupted in the middle of execution whereas, the executing process in non-preemptive scheduling is not interrupted in the middle of execution.
Preemptive Scheduling has the overhead of switching the process from ready state to running state, vise-verse, and maintaining the ready queue. On the other hands, non-preemptive scheduling has no overhead of switching the process from running state to ready state.
In preemptive scheduling, if a process with high priority frequently arrives in the ready queue then the process with low priority have to wait for a long, and it may have to starve. On the other hands, in the non-preemptive scheduling, if CPU is allocated to the process with larger burst time then the processes with small burst time may have to starve.
Preemptive scheduling is quite flexible because the critical processes are allowed to access CPU as they arrive into the ready queue, no matter what process is executing currently. Non-preemptive scheduling is rigid as even if a critical process enters the ready queue the process running CPU is not disturbed.
The Preemptive Scheduling is cost associative as it has to maintain the integrity of shared data which is not the case with Non-preemptive Scheduling.
Preemptive scheduling and non-preemptive algorithm.
Explanation:
- In the preemptive scheduling the process is assigned to the central processing unit for a period of time. If the higher priority of a process is there between the process then it holding the current process and works on the higher priority process.
- Round Robin, Priority scheduling are examples of preemptive scheduling.
- In the non-preemptive scheduling the process is not assigned to the central processing unit for a period of time. In the non preemptive scheduling firstly the process is completed after that next process is assigned to the processor.
Learn More :
https://brainly.in/question/9525970