Suspend and Resume Process in Operating System

By | September 13, 2021

Suspend and Resume Process

  • The processes may be suspended and resumed later on because of various reasons.
  • The process can be placed in a suspend state either by itself, by a parent process or by the operating system.
  • Figure shows the process state transition diagram that includes two more operations: suspend and resume. These two operations introduce two more states in the process state transition diagram : suspended ready and suspended blocked.

Suspend and Resume Process

When a ready process is suspended by an another process following transition occurs :

suspend (processname) : ready → suspendedready

When suspendedready process is made ready by another process, the transition is :

resume (processname) : suspendedready → ready

A blocked process may also be suspended by another process. This state transition is indicated as:

suspend (processname) : blocked→ suspendedblocked.

Process state diagram with suspend and resume

When a suspendedblocked process is resumed by another process, the following transition occurs:

resume (processname) : suspendedblocked → blocked

Interrupt processing

  • An interrupt is an event that alters the sequence in which a processor executes instructions.
  • An interrupt is generated by the hardware of the computer system.

The following sequence of events occur when an interrupt occurs :

  1. The operating system gains the control.
  2. The operating system saves the state of the interrupted process. This information may be stored in the interrupted process’s PCB.
  3. The operating system analyzes the interrupt and passes control to the appropriate routine that handles the interrupt.
  4. The interrupt handler routine processes the interrupt.
  5. The state of interrupted process is restored.
  6. The interrupted process executes.
  • An interrupt may be synchronous or asynchronous with the operation of the process.
  • When an interrupt is initiated by a running process (called trap), it is said to be synchronous with the operation of the process.
  • When an interrupt caused by some other event that may or may not be related to the running process, it is said to be asynchronous with the operation of the process.

Leave a Reply

Your email address will not be published. Required fields are marked *