Operating system~process definition, composition, organization, characteristics, status and conversion

Problem Description

Insert picture description here

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)
    Insert picture description here

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:

  1. A process is an execution process of a program.
  2. A process is an activity that occurs when a program and its data are executed sequentially on the processor.
  3. 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.
    Insert picture description here
    Insert picture description here

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
    Insert picture description here
    Insert picture description here
    Insert picture description here

Process characteristics

  • Process and program are two completely different concepts. Compared with program, process has the following characteristics:
    Insert picture description here

to sum up

Insert picture description here

State and transition

Overview

Insert picture description here

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.
Insert picture description here

The other two

Insert picture description here

State transition

Insert picture description here

  1. Running state → blocking state is an active behavior made by the process itself
  2. Blocking state → Ready state is the process itself controllable, it is a passive behavior
  3. 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)

to sum up

Insert picture description here

Guess you like

Origin blog.csdn.net/Shangxingya/article/details/113665255