Swapping Processes in Operating System

Previous Article

We have an intuitive understanding of process and process states from an earlier post now. If you want to know about process states and state transitions see link below.

Process States in Operating System

One of the states is the waiting state in which the process is waiting for some event or an I/O operation to complete. However, if too many processes are waiting, then the memory becomes full and there is no space for a running process.

The waiting processes are swapped out and swapped in, to free more memory for running processes.

Swapping Process
Swapping Process

Swap-In and Swap-Out

This is a very simple technique in which a process get Swapped-Out of the memory to the disk because it will not be used for some time and whenever the process is required, it is Swapped-In from the disk.

Suspended States

The waiting states are also called the Blocked states. This block state becomes suspended state after it is swapped out to the disk. We now get to new suspend states
  1. Blocked-Suspend State
  2. Ready-Suspend State


In the Block-Suspend state, the process cannot do anything because it is swapped-out and blocked. The Ready-Suspend state is a state in which the process is swapped out and waiting for some event to happen so that it can become ready again.
The external storage used for Swapping-In and Swapping-Out of processes is called Page File.

Updated Process State  Diagram

 Updated Process diagram
Updated Process diagram

Transition Between States

There are no new states, therefore the transition of states include these new states.The list of new transition is as follows
  1. Block State – Block Suspended
  2. Block Suspended – Ready Suspended
  3. Ready – Ready Suspended (when some higher priority process comes)
  4. Block Suspended – Block When there is process with higher priority than ready)
  5. New – Ready Suspended



The process Blocked and then swapped out to free some memory when the process is not likely to be used for some time. This lead to two new process states – Block Suspended and Ready Suspended



Previous Article