Process State/Model :

Introduction

  • A process is defined as an entity .
  • As we know that, a process is an independent entity which represents the basic unit of work to be implemented in the system and with its own input values, output values, and internal state.
  • A process often needs to interact with other processes. One process may generate some outputs that other process uses as input.  

Definition

  • Process states is a process model which describes the way of execution of a process occur inside a processor.       

Features

  • Using the process model, it becomes easier to know about what is going on inside the system.
  • The process model is an integral part of an operating system i.e. the lowest level of the operating system is the scheduler with a number of processes on top of it. All the process handling, such as starting and stopping processes are done by the scheduler.

Structure/Life-Cycle

  • As we know that a process is basically a program in execution. Also, the execution of a process must progress in a sequential fashion.
  • When a process executes inside processor, it passes through different states/stages. These stages may differ in different operating systems, and the names of these states are also not standardized but In general, a process may have one of the following five states at a time.
  • A process may exists in several states in different time that depends on the instruction/signal given and several other factors also, which are as follows:
    (i) New/Start :
    • This is the first or initial state of process in which a process is first started/created.

(ii) Ready :

    • This is the second state of process in which the process is waiting to be assigned to a processor.
    • Ready processes are waiting for processor allocation provided by the operating system so that they can run.
    • Process may come into this state after Start state or while running it by but interrupted by the scheduler to assign CPU to some other process.
    • It is also a wait state in which a process is waiting a little until the CPU is available.

(iii) Running :

    • This is the third state of process and once the process has been assigned to a processor by the OS scheduler, the process state is set to running
    • In this state, the processor executes its instructions on the program segment.

(iv) Waiting/Suspended/Blocked :

    • Here, the process is waiting for some event to occur.
    • In this state, process moves into the waiting state when it needs to wait for a resource, such as waiting for user input, or waiting for a file to become available.
    • When a process in the ready state, and then moved to secondary memory from the main memory due to lack of the availability of the resources is called in the Suspend ready state.

      If the main memory is full and a higher priority process comes for the execution then the OS have to make the room for the process in the main memory by throwing the lower priority process out into the secondary memory. The suspension of this ready processes remain in the secondary memory until the main memory gets available. This is also a Suspend ready state.

(v)Halted/Terminated :

    • Once the process finishes its execution completely, or it is terminated by the operating system forcibly, it is moved to the terminated state where it waits to be removed from main memory.

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.