Process Control Block (PCB)

By | September 13, 2021

Process Control Block (PCB)

Process Control Block (PCB) is a data structure used by operating system to store all the information about a process. It is also known as process descriptor. When a process is created (initialized or installed), the operating system creates a corresponding process control block.

Information in a process control block updated during the transition of process states. When the process terminates, its PCB released to the pool of free cells from which new PCBS drawn. Each process has a single PCB.

Contents of Process Control Block  (PCB)are:

 1. Process id or number

Each process is allocated a unique number for the purpose of  identification.

2. Process state

It specifies the current state of a process. A process can be in new running, ready, waiting or terminated state.

3. Process priority

Each process has a priority implemented in terms of numbers The higher priority processes has precedence over lower priority processes.

4. Pointer to parent process

A new process can create from an existing process. The existing process called the parent process. This field stores the address of PCB of parent process.

5. Pointer to child process

This field indicates the address of PCB of a child created from an existing process. process

6. Program counter

The counter indicates the address of next instruction to executed.

7. CPU registers

The number and type of registers vary with the architecture of computer. The registers usually hold the data to process, the results of calculations. These registers can index registers, accumulator, general purpose registers and various status flags. Whenever the processor switches from one process to other the content of these registers saved so that a process can resume correctly later on.

8. Memory management information

A PCB also stores information such as amount of memory units allocated to a process, the addresses of the memory areas or chunks allocated, value of page tables, segment tables. etc.

Process Control Block (PCB)

9.  I/O status information

Information such as the I/O devices allocated to the process, pending I/O tasks etc.

10. File management information

Information such as the number of open files, list of open files and the access rights of the files open such as read-only, write etc.

11. Accounting information

This information includes the amount of CPU and real time used, time limits etc.

  • Thus PCB is a central store of information that allows the operating system to locate important information about a process.
  • When the operating system switches the attention of CPU among the various active processes, it uses the save area in the PCB to hold the information it needs to restart each process when the process next gets the CPU.
  • The PCB or process descriptors privileged resources and the application processes must not allow to manipulate its contents. For this, PCBS are stored in a kernel space and are totally managed by operating system.