What is Process Suspension? What is Process Switching? Explain their purposes and difference.
Process suspension.
When all the processes in main memory are in the Blocked state, the operating system can suspended one process by putting it in the Suspended state and transferring it to disk. The space that is freed up in the memory can then be used to bring in another process
Many OS are built around (Ready, Running, Blocked) states. But there is one more state that may aid in the operation of an OS - suspended state.
When none of the processes occupying the main memory is in a Ready state, OS swaps one of the blocked processes out onto to the Suspend queue.
When a Suspended process is ready to run it moves into Ready, Suspend queue. Thus we have two more state: Blocked_Suspend, Ready_Suspend
purpose for process suspension.
----------------------------------------------------------------------------------------
Process switching.
process switch may occur any time that the operating system has gained control from the currently running process.
Considering that the system interrupts, there are two types of system interrupts out of which one is simply referred to as an interrupt and the other as a trap.
when to switch process:
supervisor call: explicit request by program ex from file .
The process will probably will blocked .
trap : an error resulted from the last instructions .
It may caused the process to be moved to terminal state
interrupt :cause of external execution of current process.
steps to process switch :
Purpose : process switch is a operating system scheduler change from one running program to another. This requires saving all of the state of the currently executing program, including its register state, associated kernel state, and all of its virtual memory configuration. All of the state of the new program is then loaded and execution continues.
Difference between process switching and process suspension are as follows :
process suspension:
Process switching:
Get Answers For Free
Most questions answered within 1 hours.