

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What happens to a PCB when the state of a process changes?
Process control block (PCB) is used by the operating system to store different information about the process including process state, registers, program counter, registers etc. It plays an important role when a context switching happens (the current process is pre-empted by another process with higher priority).
The important information stored in PCB includes the following −
Process Number (PID) − Used to uniquely identify each process.
Program counter − It stores the address of the next instruction which is to be executed.
Register Info − Includes different CPU registers such as base, accumulators and general purpose register.
State − State in the life cycle of the current executing process.
Given below is an example of a PCB −
Process state |
Process number |
Process counter |
Register |
Memory limits |
List of open files |
---------- |
Let us have a look at how the CPU switches from process to process.
Here,
During the context switch, OS must save the PCB contents of the currently executing process and then create a new PCB for the new process,
If the new process already existed, it will simply restore its PCB. The OS has a queue of PCBs, with each process having its own PCB.
All the processes and their PCB address are stored in a separate data structure called a process table.
PCB has all the necessary information for the OS to resume the execution of the process which is its main purpose.
- Related Questions & Answers
- What is the purpose of a process control block (PCB)?
- What is Process Control Block (PCB)?
- What happens when we type a URL?
- What happens when you download a Fake App?
- Execute a script when the length of the media changes in HTML?
- What happens when you add a double value to a String in java?
- What Happens When You Quit Smoking?
- How to find the number of changes when tossing a coin in R?
- What happens when we try to add a number to undefined value?
- What happens when a subclass object is assigned to a superclass object in Java?
- What happens when you do not declare a variable in JavaScript?
- What happens when you declare a method/constructor final in Java?
- What happens when a String is accepted or rejected by NPDA?
- What is the jQuery event to detect when element position changes?
- Differentiate between 5 state and 7 state process models.