Problem Description
Process definition
After the introduction of multi-program technology:
In order to facilitate the management of the operating system and complete the concurrent execution of each program, the concept of process and process entity is introduced.
PCB, program segment, and data segment constitute the process entity (process image)
- The system configures a data structure for each running program, called the process control block (PCB), which is used to describe various information of the process (such as the storage location of the program code)
The three parts of program segment, data segment and PCB constitute the process entity (process image).
Under normal circumstances, we refer to the process entity simply as the process.
For example, the so-called creation process is essentially the PCB in the process entity being created; and the revocation process is essentially the PCB in the process entity being cancelled. Note: PCB is the only sign of the existence of a process!
From different perspectives, a process can have different definitions. The more traditional and typical definitions are:
- A process is an execution process of a program.
- A process is an activity that occurs when a program and its data are executed sequentially on the processor.
- A process is a process in which a program with independent functions runs on a data set. It is an independent unit for the system to allocate and schedule resources.
After introducing the concept of process entity, a process can be defined as: a
process is the running process of a process entity and an independent unit of the system for resource allocation.
The composition of the process
- The process (process entity) is composed of three parts: program segment, data segment, and PCB.
Process organization
- In a system, there are usually tens, hundreds or even thousands of PCBs. In order to effectively manage them, these PCBs should be organized in an appropriate way.
- Divided into link mode and index mode
Process characteristics
- Process and program are two completely different concepts. Compared with program, process has the following characteristics:
to sum up
State and transition
Overview
Three basic states
A process is an execution of a program. During this execution, sometimes the process is being processed by the CPU, and sometimes it needs to wait for the CPU service to be
visible, and the state of the process will change in various ways. In order to facilitate the management of each process, the operating system needs to reasonably divide the process into several states.
The other two
State transition
- Running state → blocking state is an active behavior made by the process itself
- Blocking state → Ready state is the process itself controllable, it is a passive behavior
- Note: It cannot be directly converted from the blocking state to the running state, nor from the ready state to the blocking state (because entering the blocking state is actively requested by the process, it is necessary for the process to make this request while it is running)