Monday, May 27, 2013

Three state process model


THREE STATE PROCESS MODEL: Although the two state model is a perfectly valid design, the absence of BLOCKED state means that the processor lies idle when the active process changes from CPU cycle to I/O cycles. This design does not make an efficient use of processor. The three state model is design to overcome this problem, by introducing a new state called a blocked state. This state describes any process which is waiting for an I/O event to take place. In this case, an I/O event can mean the use of some devices or a signal from another process. The three states in this model are:
1.      RUNNING: The process that is currently being executed.
2.      READY: The process that is queuing and prepared to execute when given the opportunity.
3.      BLOCKED: A process that cannot execute until some event occur, such as the completion of an I/O operation.
At any instance the process is in one of the three states. For a single processor computer only one process can be in the RUNNING state at any one instance. There can be many processes in the READY and BLOCKED state and each of this state will have an associated queue for processes. Process entering into the system must go into the READY state; process can only enter into the RUNNING state via READY state. For each of the three state processes occupy some main memory. The transactions can be defined as-
1.      Running to Ready: The most common reasons for this type of transactions is that the running process has reached the maximum allowable time for uninterrupted execution i.e. time out occurs. Other reason can be the imposition of priority levels as determined by the scheduling policy and the arrival of higher priority process in the READY state.
Running to blocked: A process is put into the BLOCKED state if it requests something for which it must wait. A request to the OS is usually in the form of system call.

No comments:

Post a Comment