5-State Process Model

Process Suspension (Suspend State)

Motivation: Processor is faster than I/O, so all processes could be blocked on I/O.

To make the system more efficient, we can admit more processes to “Ready”. However, we have limited main memory. Therefore, we can swap blocked processes to disk (secondary memory) to free up main memory. This is why we need a new “Suspend” state.

In the 5-State Process Model, we thus introduce two new states:

  • Blocked/Suspend
  • Ready/Suspend

There’s now a Blocked/Suspend queue, and a Ready/Suspend queue.

Reasons a process might end up in suspend:

  1. Not enough memory (Swapping)
  2. Timing, taking too long / periodical execution
    • In this case, it transitions from Running Ready Ready/Suspend
  3. Parent controlling it over the child

This table shows 2 other reasons

A suspended process has the following characteristics:

  1. The process is not immediately available for execution.
  2. The process may or may not be waiting on an event (If it is, blocked/suspend)
  3. The process was placed in a suspended state by an agent: either itself, a parent process, or the OS, for the purpose of preventing its execution.
  4. The process may not be removed from this state until explicitly ordered.

Misconception

FALSE: All suspended processes reside in secondary memory (disk).

  • This isn’t necessarily true. You are confusing suspension with Swapping.

Isn't suspending a process very slow because it is a disk I/O operation?

Well, it’s more nuanced. Suspending is not always moving from main to secondary memory (that’s the definition of swapping). So yes, suspension with swapping is slow. Even with swapping, the book argues that increasing main memory results in larger processes, and not accomodating more processes (p.144)

Which process to suspend?

Many options:

  • Lowest priority process
  • Faulting process
    • This process does not have its working set in main memory so it will be blocked anyway
  • Last process activated
    • This process is least likely to have its working set resident
  • Process with smallest resident set
    • This process requires the least future effort to reload (⇒ disobeys principle of locality)
  • Largest process
    • Obtains the most free frames