Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Process control block
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{For|printed circuit boards (PCB)|Printed circuit board}} {{Short description|Data structure storing a computer process's information}} A '''process control block''' ('''PCB'''), also sometimes called a '''process descriptor''', is a data structure used by a computer [[operating system]] to store all the information about a [[Process (computing) | process]]. When a process is created (initialized or installed), the operating system creates a corresponding process control block, which specifies and tracks the process state (i.e. new, ready, running, waiting or terminated). Since it is used to track process information, the PCB plays a key role in [[context switching]].<ref>{{cite web | url=https://www.baeldung.com/cs/process-control-block | title=Process Control Block | Baeldung on Computer Science | date=25 June 2020 }}</ref> An operating system kernel stores PCBs in a process table.<ref>{{Cite web |title=Class 9: The Unix Filesystem |url=https://www.usna.edu/Users/cs/wcbrown/courses/IC221/classes/L09/Class.html |access-date=2023-12-09 |website=www.usna.edu}}</ref> The current [[working directory]] of a process is one of the properties that the kernel stores in the process's PCB.<ref>{{Cite web |title=CS 537 Notes: Directories |url=https://pages.cs.wisc.edu/~bart/537/lecturenotes/s25.html |access-date=2023-12-09 |website=pages.cs.wisc.edu}}</ref> ==Role== The role of the PCBs is central in [[Scheduling (computing)|process management]]: they are accessed and/or modified by most utilities, particularly those involved with scheduling and resource management. ==Structure== In [[Computer multitasking|multitasking]] operating systems, the PCB stores data needed for correct and efficient process management.<ref name="OSConcepts">{{cite book|last=Gagne|first=Abraham Silberschatz, Peter Baer Galvin, Greg|title=Operating system concepts|year=2013|url=https://archive.org/details/operatingsystemc00silb_198|url-access=limited|publisher=Wiley|isbn=9781118063330|edition=9th|location=Hoboken, N.J.|pages=[https://archive.org/details/operatingsystemc00silb_198/page/n130 107]β108}}</ref> Though the details of these structures are system-dependent, common elements fall in three main categories: * Process identification * Process state * Process control Status tables exist for each relevant entity, like describing memory, I/O devices, files and processes. Memory tables, for example, contain information about the allocation of main and secondary (virtual) memory for each process, authorization attributes for accessing memory areas shared among different processes, etc. I/O tables may have entries stating the availability of a device or its assignment to a process, the status of I/O operations, the location of memory buffers used for them, etc. ''Process identification data'' include a unique identifier for the process (almost invariably an integer) and, in a multiuser-multitasking system, data such as the identifier of the parent process, user identifier, user group identifier, etc. The process id is particularly relevant since it is often used to cross-reference the tables defined above, e.g. showing which process is using which I/O devices, or memory areas. ''Process state data'' define the status of a process when it is suspended, allowing the OS to restart it later. This always includes the content of general-purpose CPU registers, the CPU process status word, stack and frame pointers, etc. During [[context switch]], the running process is stopped and another process runs. 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. ''Process control information'' is used by the OS to manage the process itself. This includes: * Process scheduling state β The state of the process in terms of "ready", "suspended", etc., and other scheduling information as well, such as priority value, the amount of time elapsed since the process gained control of the CPU or since it was suspended. Also, in case of a suspended process, event identification data must be recorded for the event the process is waiting for; * Process structuring information β the process's children id's, or the id's of other processes related to the current one in some functional way, which may be represented as a queue, a ring or other data structures; * Interprocess communication information β flags, signals and messages associated with the communication among independent processes; * Process Privileges β allowed/disallowed access to system resources; * Process State β new, ready, running, waiting, dead; * Process Number (PID) β unique identification number for each process (also known as [[Process identifier|Process ID]]); * Program Counter (PC) β a pointer to the address of the next instruction to be executed for this process; * CPU Registers β register set where process needs to be stored for execution for running state; * CPU Scheduling Information β information scheduling CPU time; * Memory Management Information β page table, memory limits, segment table; * Accounting Information β amount of [[Central processing unit|CPU]] used for process execution, time limits, execution ID etc.; * I/O Status Information β list of I/O devices allocated to the process. ==Location== PCB must be kept in an area of memory protected from normal process access. In some operating systems the PCB is placed at the bottom of the process [[call stack|stack]].<ref>Yong, Zhang, "Breaking through the Maximum Process Number", "Linux Journal", 1 January 2004, [http://www.linuxjournal.com/article/4407].</ref> ==See also== * [[Thread control block]] (TCB) * [[Process Environment Block]] (PEB) * [[Program segment prefix]] (PSP) * [[Data segment]] * [[Task Control Block]] for the equivalent in IBM mainframe software ==Notes== {{Reflist}} [[Category:Process (computing)]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:For
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)