Process Management in OS

A Program does nothing unless its instructions are executed by a CPU. A program in execution is called a process. In order to accomplish its task, process needs the computer resources.

There may exist more than one process in the system which may require the same resource at the same time. Therefore, the operating system has to manage all the processes and the resources in a convenient and efficient way.

Some resources may need to be executed by one process at one time to maintain the consistency otherwise the system can become inconsistent and deadlock may occur.


The operating system is responsible for the following activities in connection with Process Management

1. Scheduling processes and threads on the CPUs.

 2. Creating and deleting both user and system processes. 

3. Suspending and resuming processes. 

4. Providing mechanisms for process synchronization. 

5. Providing mechanisms for process communication. 

Attributes of a process 

The Attributes of the process are used by the Operating System to create the process control block (PCB) for each of them. This is also called context of the process. Attributes which are stored in the PCB are described below. 

1. Process ID 

When a process is created, a unique id is assigned to the process which is used for unique identification of the process in the system. 

2. Program counter

 A program counter stores the address of the last instruction of the process on which the process was suspended. The CPU uses this address when the execution of this process is resumed. 

3. Process State

 The Process, from its creation to the completion, goes through various states which are new, ready, running and waiting. We will discuss about them later in detail. 

4. Priority

 Every process has its own priority. The process with the highest priority among the processes gets the CPU first. This is also stored on the process control block. 

5. General Purpose Registers

 Every process has its own set of registers which are used to hold the data which is generated during the execution of the process. 

6. List of open files

 During the Execution, Every process uses some files which need to be present in the main memory. OS also maintains a list of open files in the PCB. 

7. List of open devices 

OS also maintain the list of all open devices which are used during the execution of the process.