Tuesday, March 22, 2011

CASE STUDY #6 - PROCESS LIFE CYCLE


            In order to fully understand the process state diagram shown above, I will narrate how one job is process:
  1. Every process that is created by the process manager is in the hold state at the beginning. For each process there is information stored about how many memory and which devices must be allocated to allow the processor work on the process.
  2. When a process has been given all the resources it needs it is scheduled to the ready state.
  3. After some time, the process will now go to the running state where we can now say it is “in the CPU”, that is, it has been given the CPU. A process enters the running state by decision of the process manager. That decision follows a certain scheduling scheme depending on the operating system.
  4. While the process is in the running state there a three possible occurrences that your process may meet:
    • If your scheduling scheme is preemptive which means there is a possibility of an interrupt and if the process is interrupted by another process due to a certain reason from the algorithm of the scheduling scheme, it goes back to the ready state and wait until it is called to the running state.
    • If the process needs an I/O operation to finish or there is an occurrence of a page fault, the process goes to the waiting state where the I/O request or page fault will be given solution and if a signal is issued to continue processing the process goes back to the waiting state.
    • Lastly, if there are no interrupts, I/O requests, or page fault encountered, the process come to an end.
  5. During the concluding of the process, the process will be issued as finished and all the resources that the process owned will be freed.

Now, questions are raised why there is no transition from the READY state to the WAITING state and from the WAITING state to RUNNING state.

READY state to WAITING state

As written above, the process in the ready state is ready in all aspects to make effective use of the CPU while the process goes to the waiting state if it is waiting for an I/O response or there is a page fault to be resolved. I/O response and page faults are only detected in the running state therefore if the process which is in the ready state cannot proceed due to device failure it is sent back to the hold state and not to the waiting state.

WAITING state to RUNNING state

            The process scheduler only chooses from the queue of processes from the ready state to put into the running state therefore the transition from waiting-state-to-running-state bypass transition is not possible.

No comments:

Post a Comment