Process management (eight) - Process Control

Process management (eight) - Process Control

Primitive

What is the original language

In operating systems, process control usually made with primitive block.

Why the introduction of primitive

In order to perform process control during the execution of concurrent tasks in time, reduce system cost and complexity

Control primitives Category

  • Create a primitive
  • Undo primitive
  • Blocking primitives
  • Wake primitive

Create a revocation process

Create a way to process

Create a way Feature
Unity created by the system program module Relationship is equal, there is generally no resource succession relations between them
Created by the parent process Affiliation, child processes inherit parent resource exists between processes

Create a summary way

1. Whether it is a way to create a process which, when the system generates must create a system to bear part of the process of system resource allocation and management by the operating system.
2. Whether the system or parent process to create a way to create a way must be called to create a primitive implementation.

Revocation process mode

1. This process has completed the required functions and normal termination.
2. Due to some error cause abnormal termination.
3. ancestor process annulment of a child process.

Withdrawal methods summary

1. In either case causes the process to be undone, the process must release resources and PCB structure it occupies itself, in order to facilitate the effective use of resources.
2. When an ancestor process to undo a child process, the need to examine whether the child process as well as their descendants process, if any, their children and grandchildren need to undo the PCB structure and process of releasing them occupied resources.
3. After the process of releasing resources revoke primitive occupied, the corresponding PCB PCB structure off and returned to the process from an empty queue chain or process family.
4. When there is a child process, the child process to undo the PCB structure and release resources occupied by the child process, then undo the current process of PCB structure and release its resources

Blocking process

1. A process look a certain event occurs, but it occurs when conditions are not met, the process is called blocking primitives themselves to block themselves from the process execution state to the waiting state.

2. The transfer process scheduler is very important, otherwise there will be idle processor and a waste of resources.

Wake process

What is the wake-up process

When the course of events in the queue waiting for the occurrence of waiting, waiting for the event all processes will be awakened, the process from the waiting state to the ready state.

Wake of two methods

Wake system processes

1. Wake wait for the process system process, system processes and events occur unified control "incident," the message waiting notification process
2 so that the process is waiting for an event has occurred and enter the ready queue

Wake process events

1. Process wake event, the event is a partnership between the process and the process is awakened
2. Accordingly, Wake primitive can be called a system process, the process can also be invoked event occurs
call the wake primitive process 3. say as a wake-up process
4. after the process is fed into the ready queue wake up, wake primitive can either return to the original caller, you can also turn the process of scheduling, the scheduler so that the opportunity to choose a suitable process execution

Guess you like

Origin www.cnblogs.com/mengxiaoleng/p/11618336.html