Operating system--process management (processing management)

Source: Internet
Author: User
Tags terminates

I. Composition of the process

Processes are typically composed of program, data, and process Control blocks (BLOCK,PCB).

Second, the status of the process and state switching

The discontinuity of the process execution determines that the process may have multiple states, the most basic three states are as follows

① ready state, when the process has been assigned to all the necessary resources except the CPU, as long as the CPU is obtained, it can run immediately, the status of the process is called the ready state. In a system, multiple processes may be in a ready state, usually lined up in a queue, known as a ready queue.

② execution State, the process has obtained the CPU and its program is executing. In a single processor system, only one process is in the execution state, and in multiprocessor system, multiple processes are in the execution state.

③ blocking state, a thread that is in execution cannot continue execution because of an event, discards the processor and is paused, at which point the state of the process is called the blocking state, or the waiting state or blocking state. such as IO requests, request cache space, and so on, the blocked process will also be queued and may be queued for different blocking reasons.

Description: Represents the conversion between three basic states.

In addition to the above three basic states, in some systems, a new suspend state, the reason for the introduction of the suspended state is as follows

① the end user's request, when the end user discovers suspicious problems during the operation of his own program, wants to temporarily quiesce his own program, even if the executing process suspends execution, and if the user process is in a ready state and is not executed, the process will not accept the schedule. So that users can study their execution or modify the program, this state is called a pending state.

② the parent process request, sometimes the parent process wants to suspend one of its child processes in order to examine and modify the child process, or to reconcile the activities between the child processes.

③ load regulation needs, when the real-time system workload is heavier, it may affect the real-time task control, the system can be a few unimportant processes hang, to ensure that the system can function properly.

④ the operating system needs, the operating system sometimes wants to suspend certain processes in order to check for resource usage or bookkeeping in the run.

After the introduction of the suspended state, the conversion of the following States is added

① active ready, still ready, is called the active-ready state when the process is in a ready state that is not pending, and when it is suspended, it becomes still-ready and the process in the still-ready state does not accept the schedule.

② active blocking, static blocking, when the process is in a blocked state that is not suspended, is called an active blocking state, and when it is suspended, it becomes a standstill blocking state, and the process in that state will change from a standstill block to a standstill after the event it expects to occur.

③ is still ready and active, activated using activation primitives.

④ Static

Block-active blocking, activated using activation primitives.

There are two common states for process management, namely the creation state and the terminating state.

① Create a state, creating a process typically takes two steps. First, a common PCB for a new process, and fill in the necessary management information, second, the process into a ready state and inserted into the ready queue. When a new process is created, the system assigns it a PCB, fills in the process flags and other information, but because the process is necessary for the resources or other information (such as memory) has not been allocated, at this time, the process has a PCB, but it does not enter the memory itself, that is, the creation of the work has not been completed, the process can Its state is the creation state.

② terminates the state, and the process terminates in two steps. First, wait for the operating system to do the aftercare, second, its PCB cleared, and the PCB space back to the operating system. The process that enters the terminating state cannot be executed anymore, but it retains a record in the operating system, where the status code and some timing statistics are saved for other processes to collect, and the operating system will delete the process once other processes have finished extracting the information from the terminating state process.

Description: The above is a conversion between seven states.

III. Inter-process communication

1. Mutex

2. Synchronization

3. Signal Volume

PV operation

Enhancement

4. Deadlock

Operating system--process management (processing management)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.