What is a process control block?

Operating SystemHardwareSoftware & Coding

Every process is represented in the operating system by a process control block also called a task control block.

A process control block (PSB) contains many pieces of information that is associated with a specific process includes the following −

  • Process state.

  • Program counter.

  • CPU registers.

  • CPU scheduling.

  • CPU scheduling information.

  • Memory management information.

  • Accounting information.

  • I/O status information.

The structure of a process control block is as follows −

Process state
Process number
Process counter
Memory limits
List of open files

Let us discuss each task in detail.

  • Process state − The state may be a new state, ready state, running state , waiting state, terminated state and so on.

  • Program counter − It indicates the address of the next instruction to be executed for this process.

  • CPU registers − This will vary in number of types depending on its computer architecture. They include accumulator, index registers, stack pointers and general purpose registers and any general or condition code information. Along with the program counter this state information must be saved when an interrupt occurs and to allow the process to be continued correctly afterward.

  • CPU scheduling information − It includes a process priority, pointer to scheduling queues and other scheduling parameters.

  • Memory management information − It includes information like limit registers, the page tables, or segment tables depending on the memory system.

  • Accounting information − It includes the amount of CPU and real time used, time limits, account number, job or process number and so on.

  • I/O status information − It includes the list of I/O devices allocated to the process, a list of open files and so on.

Process control block is the repository for any information that may vary from, process to process.

Let us have a look on how CPU switches from process to process.

Updated on 29-Nov-2021 11:03:04