While creating a process the operating system performs several operations. To identify the processes, it assigns a process identification number (PID) to each process. As the operating system supports multi-programming, it needs to keep track of all the processes. For this task, the process control block (PCB) is used to track the process’s execution status. Each block of memory contains information about the process state, program counter, stack pointer, status of opened files, scheduling algorithms, etc. All these information is required and must be saved when the process is switched from one state to another. When the process makes a transition from one state to another, the operating system must update information in the process’s PCB.
A process control block (PCB) contains information about the process, i.e. registers, quantum, priority, etc. The process table is an array of PCB’s, that means logically contains a PCB for all of the current processes in the system.
- Pointer – It is a stack pointer which is required to be saved when the process is switched from one state to another to retain the current position of the process.
- Process state – It stores the respective state of the process.
- Process number – Every process is assigned with a unique id known as process ID or PID which stores the process identifier.
- Program counter – It stores the counter which contains the address of the next instruction that is to be executed for the process.
- Register – These are the CPU registers which includes: accumulator, base, registers and general purpose registers.
- Memory limits – This field contains the information about memory management system used by operating system. This may include the page tables, segment tables etc.
- Open files list – This information includes the list of files opened for a process.
Miscellaneous accounting and status data – This field includes information about the amount of CPU used, time constraints, jobs or process number, etc.
The process control block stores the register content also known as execution content of the processor when it was blocked from running. This execution content architecture enables the operating system to restore a process’s execution context when the process returns to the running state. When the process makes a transition from one state to another, the operating system updates its information in the process’s PCB. The operating system maintains pointers to each process’s PCB in a process table so that it can access the PCB quickly.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Thread Control Block in Operating System
- Difference between Flow Control and Congestion Control
- Difference between Flow Control and Error Control
- Page Table Entries in Page Table
- Process states and Transitions in a UNIX Process
- Process Scheduler : Job and Process Status
- Difference between Process Image and Multi Thread Process image
- Boot Block in Operating System
- Bad Block in Operating system
- Pass the value from child process to parent process
- Introduction of Control Unit and its Design
- Difference between Hardwired and Micro-programmed Control Unit | Set 2
- Difference between Horizontal and Vertical micro-programmed Control Unit
- Difference between Hardwired and Microprogrammed Control Unit
- Error Control in TCP
- Computer Organization | Hardwired v/s Micro-programmed Control Unit
- TCP Congestion Control
- Congestion Control techniques in Computer Networks
- Lock Based Concurrency Control Protocol in DBMS
- Two Phase Locking (2-PL) Concurrency Control Protocol | Set 3
This article is contributed by Rajshree Srivastava. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.