Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
429 views

Process Control Block

The Process Control Block (PCB) is a data structure used by operating systems to manage processes. It contains process identification data like a unique ID, process state data like register values for context switching, and process control data used for scheduling, interprocess communication, and resource management. Common elements of a PCB include the process ID, program counter, CPU registers, scheduling information, and memory and I/O management data. PCBs allow the OS to suspend, resume, and multitask processes efficiently.

Uploaded by

Vishal Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
429 views

Process Control Block

The Process Control Block (PCB) is a data structure used by operating systems to manage processes. It contains process identification data like a unique ID, process state data like register values for context switching, and process control data used for scheduling, interprocess communication, and resource management. Common elements of a PCB include the process ID, program counter, CPU registers, scheduling information, and memory and I/O management data. PCBs allow the OS to suspend, resume, and multitask processes efficiently.

Uploaded by

Vishal Singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PCB: -

Process Control Block (PCB, also called Task Controlling Block, Entry of the Process Table, Task
Struct, or Switch frame) is a data structure in the operating system (kernel) containing the information
needed to manage the scheduling of a particular process. The role of the PCBs is central in process
management: they are accessed and/or modified by most OS utilities, including those involved with
scheduling, memory and I/O resource access and performance monitoring. It can be said that the set of the
PCBs defines the current state of the operating system. Data structuring for processes is often done in terms
of PCBs.

Structure of PCB: -
In modern sophisticated multitasking systems, the PCB stores many different items of data, all needed for
correct and efficient process management.[1] Though the details of these structures are obviously system-
dependent, we can identify some very common parts, and classify them in three main categories:

 Process identification data


 Process state data
 Process control data
The approach commonly followed to represent this information is to create and update status tables for each
relevant entity, like memory, I/O devices, files and processes.
Memory tables, for example, may 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 being executed, the location of memory buffers used for them, etc.
1. Process identification data always include a unique identifier for the process (almost invariably an
integer number) and, in a multiuser-multitasking system, data like 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 OS tables defined above, e.g. allowing to identify which process
is using which I/O devices, or memory areas.

2. Process state data are those pieces of information that define the status of a process when it is
suspended, allowing the OS to restart it later and still execute correctly. This always includes the
content of the CPU general-purpose registers, the CPU process status word, stack and frame pointers
etc. During 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.

3. Process control information is used by the OS to manage the process itself.

These includes:

 The process scheduling state: The state of the process in terms of "ready", "suspended", etc., and
other scheduling information as well, like 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: 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: various flags, signals and messages associated with the
communication among independent processes may be stored in the PCB.
 Process Privileges in terms of allowed/disallowed access to system resources.
 Process State: State may enter into new, ready, running, waiting, dead depending on CPU scheduling.
 Process Number (PID): A unique identification number for each process in the operating system (also
known as Process ID).
 Program Counter (PC): A pointer to the address of the next instruction to be executed for this process.
 CPU Registers: Indicates various register set of CPU where process need to be stored for execution for
running state.
 CPU Scheduling Information: indicates the information of a process with which it uses the CPU time
through scheduling.
 Memory Management Information: includes the information of page table, memory limits, Segment
table depending on memory used by the operating system.
 Accounting Information: Includes the amount of CPU used for process execution, time limits,
execution ID etc.
 I/O Status Information: Includes a list of I/O devices allocated to the process.

You might also like