Process Control Block

Forgetforget
4 min readMar 25, 2022

Abstract (Should cover the need for PCB)

The process control block is a data structure that holds information for a process required to run for a process. This tells the computer memory where to work and how much storage for that process and how much time the CPU requires for that process. Process control block supports multiprocessing like word, ms paint, pdf reader-run at the same time that runs in task manager in windows.

Preemptive: computer memory may take allocated resources from the process or maybe terminate the process.

Non-preemptive: computer memory can’t take allocated resources from the process until the process is completed.

What is a Process Control Block (PCB)?

When any process enters in computer memory at the time of entering into computer memory makes data structure for that process to store all the information related to that process for further calculator and completion of that process. That data structure is PCB or process control blocks. In further stages of the process, computer memory requires so much information about the process that information is supplied from data structure or process control blocks. Like storing items on a shelf or almirah in some sense, computer memory allocates space to store information of a process. Every process in computer memory or system has its process control block. All the process control blocks are connected by a linked list. The process control block is like a shelf or almirah. For example, in the first block we can store clothes related to winter, in the second block, we can store clothes related to summer, and so on. Also in the first block separation on the right side put clothes related to the night, on the left side clothes related to morning, and so on.

Role of process control block

  1. In the present age of technology, a computer is required to work for a large number of processes so that multiprocessing is possible by the process control block because of PCB.
  2. If any instance of time computer memory does not have enough memory then the process will be in a suspended ready state then the process control state holds enough memory so that process can be resumed again in computer memory.
  3. Process state blocks are data structures that contain an identifier, state memory pointer, priority, program counter so that computer memory can find what is the current state of any process and send it to where it needs to send.
  4. Using the process control block operating system tells what is the state of the process.
  5. A bug in the process control block can disturb the routine of computer memory.
  6. Changes in the process control block can disturb the various other tasks of the operating system.

Attributes of a Process Control Block

process control block holds the following information himself:

  1. Process Id: unique Identification Number for every process allocated by the computer memory also called PID or process identification Number. example: MAX31855
  2. Process State: Current state of the process. I.e., ready, run, new, suspend, terminate, suspend, block or wait.
  3. Pointer: an address of the parent process control block.
  4. Priority: there is a case when a process is very essential in comparison to another process then ignore which comes first then Priority values in PCB tell which process first run in computer memory.
  5. Program counter: an address of the next instruction of that process.
  6. CPU Register: when the process is running in the computer the data related to that process is stored in the register. So, when the process is resumed from suspend state then data comes from these CPU registers.
  7. Process privileges: whether a process is allowed or disagrees to run in computer memory.
  8. Memory Management Information: Information related to memory state, memory execution time.
  9. Input-output status information: this tells us the computer memory how many files, devices need for that process.
  10. List of open files: this tells the number of files required for the process.
  11. List of open devices: this tells the number of devices required for that process.
  12. Accounting information: this tells us to computer memory about the process time limits, process number, amount of central processing unit required for that process.

This is how a single process control block holds information about a process. For each attribute, further details work in CPU memory.

How are PCBs stored?

For process control block hold Program counter which contains the address of next process control block.

Conclusion:

  1. The process control block is hidden from normal users in computer memory. It is kept in a private area that cannot be accessed by normal users. This is because the process control block contains important information.
  2. Process control block occupies in main memory.
  3. There must be one Process control block for one process.
  4. The process control block is a data structure that holds information that is essential for the proper execution of a process.
  5. For a particular process control block, computer memory allocates space for that process control block.

--

--