Process Control blocks PCB (processing control block)
1. Overview of the Process Control block: The Process Control block (processing control blocks) is a data structure in the core of the operating system that mainly represents the state of the process. The purpose of this is to make a program (with data) that cannot be run independently in a multi-channel program environment, to be a basic unit that can run independently, or a process that executes concurrently with other processes. In other words, the OS is based on the PCB to control and manage the concurrent execution of the process. The PCB is usually a contiguous storage area in the system memory footprint, which holds all the information the operating system needs to describe the process and control the process . It makes a program that cannot run independently in a multi-channel program environment become a basic unit that can run independently or a process that can execute concurrently with other processes.
2.PCB and System relationships: the Process Control block (PCB) is a specialized data structure that the system sets for managing processes. It is used by the system to document the external characteristics of the process and to describe the process of its movement. At the same time, the system can use the PCB to control and manage the process, so that the PCB (Process Control block) is the system-aware process is the only sign of the existence.
3.PCB recorded information:
The PCB usually records information about the process, including:
- Program counter: The address of the instruction to be run.
- Process state: Can be new, ready, running, waiting, or blocked, and so on.
- CPU scratchpad: such as accumulator, index scratchpad (index register), stack pointer and general purpose scratchpad, state code, etc., the main purpose is to temporarily store the data at the time of interruption, so as to continue to use later, and the number and class of the computer architecture vary.
- CPU scheduling: Priority, scheduling, and other pointers and other parameters.
- Memory management: such as tab table.
- Accounting information: such as CPU and actual time use amount, time limit, account number, work or process number.
- Input and Output status: The configuration process uses an I/O device, such as a tape drive.
4. How the Process control block PCB is organized
1>. Linear table mode: Regardless of the state of the process, all PCBs are kept in the system area of the memory continuously. This approach applies to situations where the number of processes in the system is not large. 2> Index Table Method: This method is an improvement of the linear table, the system according to the state of the process to establish a ready index table, blocking the index table, and so on. 3>: The system of the process in accordance with the State of the process of the PCB composition of the queue, thus forming a ready queue, blocking queue, running queue and so on. Reference: Process Control block PCB structure task_struct Description: http://blog.csdn.net/jnu_simba/article/details/11724277
Operating system notes-composition of processes-Process control block 2015-6-5