DIFFERENT BETWEEN PREEMPTIVE AND NON-PREEMPTIVE

PREEMPTIVE

  • In preemptive scheduling, CPU is snatched from a process either due to time constraints or priority reasons.
  • In preemptive scheduling, and executing process is stopped executing and returned to the ready queue to make CPU available for another ready process.
  • CPU switches among the ready processes instead of waiting for each process to terminate before executing the next.
  • Preemption takes after a fixed interval of time quantum.
  • Suitable in a multiprogramming environment.
  • Needs special hardware. For example a timer for time support.
  • Costlier as compared to non-preemptive.
  • Increases CPU utilization.

NON-PREEMPTIVE

  • method once assigned the mainframe keeps the death penalty till the mainframe is free either by a switch to a waiting state or by termination.
  • A process is executed by the CPU until it completes or goes for an I/O and restart execution.
  • There will never be more processes, the rest will have to wait until the CPU is free.
  • No preemption or time constraint is implemented.
  • Suitable for the uniprocessor system.
  • It does not require special hardware. For example a timer.
  • Requires lesser cost as compared to preemptive.
  • CPU sits idle.