III.2.2 Process control block

Process states

When a process is running it changes states. The state of a process is defined in part by the current activity of that process. Each process can be in each of the states in the following figure.

New/created : the process is being created,

Ready: The process can run as soon as it takes control of the processor. A process is in ready state if it has all the resources it is only waiting for the CPU resource. A process enters the ready state if the expected event occurs or if during execution the process found itself obliged to free the processor for the benefit of another process.

Running/executing: Process instructions are executing, only one process at a time can be in executing state.

Waiting/blocked: The process is waiting for an event to occur, this event is usually the completion of an I/O.

Terminated: state of a process which has finished its execution but whose information is kept by the OS (under Unix-like OS, we speak of a zombie process)

An OS maintains information about a terminated process if it has an I/O operation that finishes or if child processes of the latter are still running, etc.

NB: In Unix-like OS, a process can create child processes using either the SVC fork or exec). As well as, it can destroy them using the SVC kill.

III-2-3 Process control block

Each process is represented in the OS by a process control block (PCB). The PCBs of the processes created in the OS are grouped in the process table.

A PCB contains the information of a process including:

  •      the state of the process which can be new, ready, running, blocked or terminated,
  • the instruction counter which indicates the address of the next instruction to be executed by this process,
  • CPU registers: Registers vary in number and type depending on the architecture of the computer. This saved information makes it possible to resume the execution of a process following an interruption,
  • CPU scheduling information: this information includes all scheduling parameters such as process priority and pointers to scheduling queues,
  • memory management information: This information may include memory management information that pertains to the process. Such as base and limit registers, Memory pages and segments depending on the OS,
  • accounting information: this information takes into account the amount of processor time, real time used, time limits, account numbers and job or process numbers,
  • I/O status information: includes a list of I/O devices allocated to this process, a list of open files.
آخر تعديل: الأحد، 6 أبريل 2025، 8:19 AM