Process Control Block PCB

What is PCB (Process Control Block)?

PCB is a data structure in the OS and it contains all the information about a process.

How PCB of a process is created in OS?

When a process is created, the operating system creates a corresponding process control block for storing the information of that process.

PCB diagram in OS

I am sharing the structure of PCB in OS with the help of a diagram.

What information does an OS store in a PCB?

The following information is stored in PCB;

Process ID in PCB

When the OS converts a program into the process then OS assigns process ID to each process.

State of the process
in PCB

PCB maintains the record of the state of each process. A process can be in new, waiting, ready, running and can be in the terminated state. Two state, 5 state, 7 state and some other process models are used to represents the flow of the process from one state to another state.

Program counter in PCB

Program counter stores the counter. This counter contains the address of the next instruction that is to be executed.

Priority of the process in PCB

Sometimes we need to assign priority to each process. Assigning the priorities is referred as preemptive scheduling and when we don’t follow the priorities, then its known as non preemptive scheduling. For example in priority scheduling, OS developers maintain the priority for each process.

Process Privileges in PCB

PCB maintains the record of all the privileges assigned to each process. For example privileges of reading, Write, Copy, etc.

Memory management information in PCB

PCB manage the memory by maintaining the record that how much memory is available for use and how much memory is allocated to the processes etc. For example when you read about deadlock of the processes in OS, then you will see that in Banker’s algorithm we need to manage the memory by keeping a record of the allocated resources and free resources etc. This is possible by saving the record in the process control block.

I/O status information
in PCB

process control block PCB
Figure: process control block PCB

Inter-process communication information in PCB

Sometimes a process works independently and sometimes some processes work together to achieve a big task.

Accounting information in PCB

OS can count the different parameters like the usage of hard disk, CPU and RAM etc.

Thread control block

A PCB will have one or more Thread control block (TCB) linked to it.

Important Questions about PCB

What is PCB full form in OS?
Answer: Full form of PCB in Operating systems is the process control block.

Define PCB in OS?

PCB is a data structure in the OS and it contains all the information about a process.

Why OS uses PCB for each process?
If operating system not store the compulsory information about the process in process control block, then OS is unable to manage and handle the process accurately and efficiently.

Process control block in os  | process control block diagram in os | process control block in operating system pdf | process control block example | process control block in the Linux | thread control block.