The process control block is the data structure that contains information about the state of the process, its instruction counter, CPU register, Stack pointer, memory usage, and the state of its open files. The PCB includes a lot of information linked with a particular process. It is also known as a task control block.
Every process in the operating system is specified by a process control block. If a process requires a transformation from one state to another then the operating system must renew information in the PCB of that process. The operating system manages pointers to every process’s PCB due to this it can access the process control block rapidly.
Information contained about a program in the Process control block includes
Informations PCB Contains about Process
- The process identifier: It is a unique key that is used to uniquely identify processes. The PID does not change during the runtime of the process.
- Process status: Process is ready to be computed, blocked, or terminated.
- Program counter: It includes the address of the next instruction that requires to be executed.
- List of Open files: It includes several files which are linked with the process.
- Scheduling algorithm: This includes the priority of the process, pointers to the scheduling queues, and other scheduling parameters.
- Accounting: The operating system also keeps records of how long a process has been calculating, how much memory it uses, etc.
- Input/Output information: This includes a list of the I/O devices connected by the process, including open files for example.
- Memory management information: It contains page tables or segment tables and also contains the value of base registers, limit registers, and many more.