|
A Process Control Block (PCB, also called Task Control Block or Task Struct) is a data structure in the operating system kernel containing the information needed to manage a particular process. The PCB is "the manifestation of a process in an operating system".[1] An operating system (OS) is a software that manages computer resources and provides programmers with an interface used to access those resources. ...
A kernel connects the application software to the hardware of a computer. ...
Included information Implementations differ, but in general a PCB will include, directly or indirectly: - The identifier of the process (a process identifier, or PID)
- Register values for the process including, notably,
- the Program Counter value for the process
- The address space for the process
- Priority
- Process accounting information, such as when the process was last run, how much CPU time it has accumulated, etc.
- Pointer to the next PCB i.e. pointer to the PCB of the next process to run
- I/O Information (i.e. I/O devices allocated to this process, list of opened files, etc)
During a context switch, the running process is stopped and another process is given a chance to run. The kernel must stop the execution of the running process, copy out the values in hardware registers to its PCB, and update the hardware registers with the values from the PCB of the new process. In computing, the process identifier (normally referred to as the process ID or just PID) is a number used by some operating system kernels (such as that of UNIX or Windows NT) to uniquely identify a process. ...
In computer architecture, a processor register is a small amount of very fast computer memory used to speed the execution of computer programs by providing quick access to frequently used valuesâtypically, these values are involved in multiple expression evaluations occurring within a small region on the program. ...
The program counter (also called the instruction pointer in some computers) is a register in a computer processor which indicates where the computer is in its instruction sequence. ...
In computing, an address space defines a range of discrete addresses, each of which may correspond to a physical or virtual memory register, a network host, peripheral device, disk sector or other logical or physical entity. ...
CPU redirects here. ...
A context switch is the computing process of storing and restoring the state (context) of a CPU such that multiple processes can share a single CPU resource. ...
Location of the PCB Since the PCB contains the critical information for the process, it must be kept in an area of memory protected from normal user access. In some operating systems the PCB is placed in the beginning of the kernel stack of the process since that is a convenient protected location. [2] In computer science, a call stack is a special stack which stores information about the active subroutines of a computer program. ...
Notes
- ^ Deitel, Harvey M. [1982] (1984). An introduction to operating systems, revisited first edition, Addison-Wesley, 673. ISBN 0-201-14502-2. pages 57-58
- ^ Yong, Zhang, "Breaking through the Maximum Process Number", Linux Journal, 1 Jan 2004, [1].
|