Preemptive and non preemptive
Preemptive
In preemptive Scheduling algorithm, the the running process is interested by the higher priority process. When a currently running process finish execution, the priority of the ready state process is checked against that of the running process. If the priority of the ready process is higher, it is allocated to the CPU.
- A Scheduling discipline is primitive, if the CPU is taken away from the process after being allocated.
- Cost of the preemptive scheduling is higher then non preemptive scheduling.
- Higher priority jobs are processed before the lower priority jobs.
Non preemptive
In non preemptive Scheduling, the CPU has been allocated to a process, the process keeps the CPU until it release the CPU either by switching to the waiting state. This scheduling method is used by Microsoft Windows 3.x, window 95 introduced preemptive scheduling.
- A scheduling discipline is non preemptive, if the process has been given the CPU, the CPU cannot taken away from that process.
- It is not costly as compared to preemptive scheduling.
- Short jobs are made to wait by longer jobs.
CPU scheduling decisions may take place under the following circumstances
- When a process switches from the running state to the waiting state.
- When a process switch from the running state to the ready state.
- When a process which from the waiting state to the ready estate.
- When a process terminates.
- When scheduling takes place only under circumstance 1 and 4, we can say that the scheduling scheme is non preemptive or Co-operative, otherwise it is preemptive.
Comments
Post a Comment