Process Control Block in Operating System (OS)
What is a process control block or PCB?
PCB or Process control Block is a data structure which has all the information that is needed by a schedular to schedule a particular process, this data structure rests in the operating system Kernel.
Process ID or PID
This basically is an unique integer ID for a particular process being carried out. The PCB keeps the track of this and other relevant information related to any process.
The following are kept track of by the PCB –
- Process ID or PID – Unique Integer Id for each process in any stage of execution.
- Process Stage – The state any process currently is in, like Ready, wait, exit etc
- Process Privileges – The special access to different resources to the memory or devices the process has.
- Pointer – Pointer location to the parent process.
- Program Counter – It will always have the address of the next instruction in line of the processes
- CPU Registers – Before the execution of the program the CPU registered where the process needs to be stored at.
- Scheduling Information – There are different scheduling algorithms for a process based on which they will be selected in priority. This section contains all the information about the scheduling.
- Memory Management Information – The operating system will use a lot of memory and it needs to know information like – page table, memory limits, Segment table to execute different programs MIM has all the information about this.
- Accounting Information – As the name suggest it will contain all the information about the time process took, Execution ID, Limits etc.
- I/O Status – The list of all the information of I/O the process can use.
The PCB architecture is completely different for different OSes. The above is the most generalised architecture.
- Process (Intro)
- Process Life Cycle
- Process Control Block PCB
- Process Scheduling
- Context Switching
- CPU Scheduling
- FCFS Scheduling
- Shortest Job First (or SJF) scheduling – non-preemptive
- Shortest Job First (or SJF) scheduling – preemptive (SRTF)
- Round Robin scheduling
- Priority Scheduling
- Convoy Effect
- Difference between Scheduler and Dispatcher
- Preemptive scheduling vs Non Preemptive scheduling
- Preemptive scheduling
- Non preemptive scheduling