Skip to main content

Preemptive vs non-preemptive; process states

Short answer

Preemptive scheduling lets the OS forcibly remove the CPU, while non-preemptive leaves a process running until it yields. A process is a program in execution; its states are New, Ready, Running, Blocked/Waiting, and Terminated.

Differentiate between preemptive and non-preemptive scheduling. Define process and explain its possible states.

Preemptive vs non-preemptive scheduling

In non-preemptive scheduling a process keeps the CPU until it finishes or blocks; the OS cannot take it away. In preemptive scheduling the OS may remove a running process from the CPU, for instance when its quantum expires or a higher priority process arrives.

BasisPreemptiveNon-preemptive
CPU releaseForced by OSVoluntary (end or wait)
Response timeGood, suits interactive/real-timePoor for short jobs behind long ones
Context switchesMore overheadFewer
SynchronizationNeeded for shared dataSimpler
FairnessBetterConvoy effect possible
ExamplesRound robin, SRTF, preemptive priorityFCFS, SJF, non-preemptive priority

Process and its states

A process is a program in execution, including the program counter, registers, stack, data and resources.

Possible states (five-state model):

  1. New: the process is being created.
  2. Ready: waiting in memory for the CPU.
  3. Running: instructions are being executed.
  4. Blocked/Waiting: waiting for an event such as I/O completion.
  5. Terminated: execution has finished.
 New --admit--> Ready --dispatch--> Running --exit--> Terminated
                  ^  <---timeout----   |
                  |                    | wait for event
                  +---- Blocked <------+
                  (event occurs)

Further states exist in systems with swapping: suspended ready and suspended blocked, when the process is moved from memory to disk.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 2 questions →