Monday, May 27, 2013

Explain 5 state process model


This is the more sophisticated design. The use of portion of hard disk to emulate main memory(so called virtual memory) requires additional state to describe the state the state of process which are suspended from main memory and place in virtual memory, is the reason, this model was evolved. A process can be suspended from the RUNNING, READY or BLOCKED state, giving rise to two other states, namely, READY SUSPEND and BLOCKED SUSPEND. A RUNNING process that is suspended becomes READY SUSPEND and a BLOCKED process that is suspended becomes BLOCKED SUSPEND. A process can be suspended for no of reasons; the most significant of which arises from the process being swapped out of the memory by memory mgmt system inorder to free memory for other process. This model considers the following transactions-
1.      Suspend Blocked then Blocked: If the process in the RUNNING state requires more memory, then atleast one BLOCKED process can be swapped out of memory onto disk. The transaction can also be
made for the BLOCKED process if there are READY processes available, and the OS determines the READY process it would like to dispatch requires more main memory to perform good performance.
2.      Suspend Blocked then Suspend Ready: The process in SUSPEND BLOCKED is moved to the SUSPEND READY state when the event for which it has been waiting occurs. This requires the state information concerning suspended processes be accessible to the OS.
3.      Suspend Ready then Ready: When there are no READY processes in the main memory, the OS need to bring one in to continue execution. In addition, it might be the case that the process in the READY SUSPEND state has higher priority than any other processes in the READY state.
4.      Suspend then Ready: Normally the OS should be designed so that the preference would be to suspend a BLOCKED process rather than the READY one.

No comments:

Post a Comment