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.
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 :
- The operating system gains the control.
- The operating system saves the state of the interrupted process. This information may be stored in the interrupted process’s PCB.
- The operating system analyzes the interrupt and passes control to the appropriate routine that handles the interrupt.
- The interrupt handler routine processes the interrupt.
- The state of interrupted process is restored.
- 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.