INTRODUCTION TO PROCESSES DESCRIPTOR & PROCESS CONTROL BLOCK

2 min


PROCESS CONTROL BLOCK

Process control blocks These items (and more discussed later) are collectively known as the process state. If we were only running one process on a system then there would be nothing much more to say about the process state. But these days we are not normally running only one process.

We are rapidly switching between many processes in an effort to keep the hardware very busy and responsive to the user(s). While we want the system to be able to run many processes at the same time, we want this switching among processes to be transparent to the processes themselves (i.e., a process does not need to know whether or when it will be suspended and another process run). We are creating a “virtual CPU” in the sense that every process can act as if it were the only process running. Process control block Since we are doing all this switching between processes, when we stop one process to start another we will have to save the state.

This assumes that the process we are starting is not a new process.) We will create a structure in memory where we will save the information describing the state of the process we are stopping. We will call this structure a process control block ( PCB ). Some OSs call this structure a process descriptor.

PROCESS DESCRIPTOR—PROCESS CONTROL BLOCK

A process control
block.

As was just described, when a process is stopped by the OS for any reason, the state of the CPU at that time is saved in the PCB. Process control block There are many other pieces of information in the PCB as well. A typical PCB.

Will keep different information in the PCB, but here are some things that are fairly common:

  • Program name
  • Process ID, a number assigned by the OS to identify the process
  • Parent process ID or a pointer to the parent process PCB
  • Pointer to a list of child PCBs  Pointer to the “next” PCB, probably in a queue
  • Accounting information
  • Pointer to a table of open files
  • CPU state information
  • Instruction counter
  • The stack pointer(s)
  • System status register
  • Other system registers
  • Event descriptor, valid if the process is waiting for something
  • Process state information (see next section)
  • Process owner (user)
  • Memory management information
  • Pointer to a message queue
  • Pointer to an event queue

It is saved only when the process is stopped for some reason. Note that the term “state” is overloaded. We have been talking about the “state” of the CPU and said that we saved that information in the part of the PCB called the “CPU state information” when we stopped a process. Process control block You may have noticed that the PCB also has another entry called “process state information.” This is something different, and it is coming up next.

PROCESS STATES AND TRANSITIONS

The designers of OSs have to document the external view of their systems so that programmers will know how to write programs for them and users will know how to run the programs. Some of the things that need to be discussed can be described in several ways. An example is a concept of “states” that a process can be in. The most obvious state for a process is that it is running. Process control block But only one process can be running at any time on each CPU, so what are the other processes doing? Some of them are ready to run and some of them are waiting for something else to happen before they continue.

Also Read:-

File system directory tree the multiuser os environment


Like it? Share with your friends!

error: Content is protected !!