1, define
Process is the abbreviation of Process entity, process entity consists of program segment and its related data and PCB (process controle block) Process Control block, the creation process is essentially a PCB in the process entity, the Process Control block is a data structure specially allocated for the program, It is used by the system to describe the basic situation of the process and the process of activity.
A process is a single execution of a program.
2, Process creation
Process creation is a complex process, typically through multiple steps to complete: for example, the operating system first request a blank PCB for the program and its data, and fill the PCB with information to control and manage the process, and then assign the process the resources necessary for the runtime Finally, the process is transferred to the ready state and inserted into the ready queue. If the resources required by the process are not yet satisfied, such as the system does not have enough memory to allow the process to mount, the creation is not completed and the process cannot be scheduled to run, at which point the status of the process is called the creation state.
3, the state of the program
The state of the process has three basic States and two special States (create State and terminate state), basic state is ready, execute, block. The process will often take a state transition during the run, for example, a process that is in a ready state can execute after the dispatcher has allocated the CPU, whose state is changed from the ready state to the execution state, and the executing process is blocked by the execution of the current process if the time slice allocated to it is exhausted and the CPU is suspended from execution. So that it cannot continue executing, the process is changed from execution state to blocked state.
When a process executes an I/O request, the state of the process transitions from the execution state to the blocking state until the I/O request completes and the blocking state goes to the execution state to continue execution, so a large amount of IO request overhead slows down the entire application's response speed
The termination of the process also has to pass two steps: First wait for the operating system to clean up, finally its PCB cleared, and the PCB space return system. When a process reaches the natural end point or an insurmountable error occurs, or is terminated by the operating system, or is terminated by another process with termination, it goes to the terminating state. The process that enters the terminating state can no longer be executed, but a record is maintained in the operating system, where the status code and some timing statistics are saved for other processes to collect. Once the other process has collected the information, the operating system will remove the process, both clearing the PCB and returning the blank PCB to the system.
The process of operating system