OS Swapping Processes

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.

Advertisements

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.

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.

Advertisements
Swapping Process
Figure 1 – Swapping Process

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

  • Blocked-Suspend State
  • 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
Figure 2 – 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

  • Block State – Block Suspended
  • Block Suspended – Ready Suspended
  • Ready – Ready Suspended (when some higher priority process comes)
  • Block Suspended – Block When there is process with higher priority than ready)
  • New – Ready Suspended

Summary

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

References

  • Abraham Silberschatz, Peter B. Galvin, Greg Gagne (July 29, 2008) Operating System Concepts, 8 edn., : Wiley.
  • Ramez Elmasri, A Carrick, David Levine (February 11, 2009) Operating Systems: A Spiral Approach, 1st edn., : McGraw-Hill Education.
  • Tanenbaum, Andrew S. (March 3, 2001) Modern Operating Systems, 2nd edn., : Prentice Hall.

Advertisements

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.