OS

Process Management

Process Management

Process: A process or task is an instance of a program in execution. The execution of a process must programs in a sequential manner. At any time at most one instruction is executed. The process includes the current activity as represented by the value of the program counter and the content of the processors registers. Also it includes the process stack which contain temporary data (such as method parameters return address and local variables) & a data section which contain global
variables.

Difference between process & program:
A program by itself is not a process. A program in execution is known as a process. A program is a passive entity, such as the contents of a file stored on disk where as process is an active entity with a program counter specifying the next instruction to execute and a set of associated resources may be shared among several process with some scheduling algorithm being used to determinate when the stop work on one process and service a different one.
Process state: As a process executes, it changes state. The state of a process is defined by the correct activity of that process. Each process may be in one of the following states.

    • New: The process is being created.
    • Ready: The process is waiting to be assigned to a processor.
    • Running: Instructions are being executed.
    • Waiting: The process is waiting for some event to occur.
    • Terminated: The process has finished execution.

Many processes may be in ready and waiting state at the same time. But only one process can be running on any processor at any instant.