Prev Next

Process State and its Transition







The Central Processing Unit (CPU) executes a large number of programs. While its main concern is the execution of user programs, the CPU is also needed for other system activities. These activities are called processes. In general, a process will need certain resources such as the CPU time, memory, files, I/O devices and etc. to accomplish its task. As a process executes, it changes state. The state of a process is defined by its current activity. In the diagram above, each process may be in one of the following states: hold state, ready state, waiting state, running state, and finished state.

As shown in the diagram, there is no transition happen from the READY STATE to WAITING STATE as well as from WAITING STATE to RUNNING STATE. Why?


READY STATE to WAITING STATE

There is no transition happen from the READY STATE to WAITING STATE. The reason is, the process that stays at the waiting state is the process that has been block at its running state. When a process blocks, logically it cannot continue, typically because the process is waiting for an input or response from any peripheral devices required for its execution. The process on this state is unable to run until some external event happens. In general, the process is waiting for some event to happen such as an I/O completion before it can proceed. Then if there is, there will be a signal issued from the waiting state to ready state to inform that the process is ready to be executed. On the other hand, the process on the ready state is waiting to be assigned to a processor. But for instance, if the process in the ready state cannot proceed due to its failure of device required, it should be sent back to the hold state, not in the waiting state. The process will be sent to waiting state only if the process is waiting for an event from its peripheral devices needed for it to execute. Therefore, there is no transition in the READY STATE to WAITING STATE.


WAITING STATE to RUNNING STATE

The process scheduler chooses the processes or jobs to be executed only at the running state. Therefore, there is no transition happen between WAITING STATE to RUNNING STATE for the reason that there is no possibility to process a job by bypassing the running state. Also, in the waiting state, jobs on this state are the jobs waiting for an event happen from its required external devices or either waiting for its I/O completion.