Process management of the operating system (1)

Source: Internet
Author: User
Tags requires

I believe a lot of people have used the task manager, as shown in the following figure:

All currently running processes, including applications, background services, and so on, are displayed under the tab of the process, and can be found here in the depths of the system, but only if you have to know the name of the program. Because of this, when the application does not respond, that is, as the saying goes, when you call up the Task Manager, forcibly terminate the application or process, you can end the state of the card dead.

To say so much is to make everyone have an intuitive concept of the process. So what is a process, and what is its definition. Why there is a process. ...... I'll go ahead and talk to you.

The concept of the process originated in the early 1960s and was first introduced by the Multics system of the United States, MIT and IBM's ctss/360 system, and was widely used by the researchers and designers of subsequent operating systems. Of course, as with the operating system, there is currently no uniform definition of the process. Here are a few things to consider:

1. A process is an execution of a procedure.

2. A process is a program that can participate in the execution of concurrent processes.

3. A process is the activity that occurs when a program executes with data through the processor.

4. The so-called process is a process that executes on a processor in a given space and initial environment.

The definition of China's domestic operating system seminar in Lushan in 1978 was that a process is a program with a certain set of independent functions. A running activity for a data collection.

Why would there be a process? Because the program running in the multi-channel program system is in the state of the time-off. When a program obtains the processor resources and pushes forward, when it needs some kind of resource and does not get it, it has to stop temporarily, wait until the resources needed to continue to move forward. Then, when the program is paused, the interrupted information must be saved so that when the pause is resumed, the information will resume and execution begins at the breakpoint. In this way, a program running in a multi-channel program requires a region where the breakpoint field information is saved, and this area is not part of the program, and therefore requires a term that can more accurately describe the execution of the program in a multi-channel program system, which is called a process.

The process has 3 basic states: Run state, ready state, waiting state. The conversion relationship between them can be described in the following diagram:


Of course, for different processor scheduling algorithms, the process state transition diagram may be slightly different.

Here are a few very important concepts, if not very clear can look up information, I will not repeat.

Process Control block (PCB): A data structure that flags the process, which contains all the information that the system needs to manage the process.

A process consists of two parts, the PCB and the program, where the program includes code and data.

To achieve the management of the process, the system organizes the processes into several queues, and the process queues in the system are divided into 3 classes: The ready queue, the waiting queue, and the running queue.

From the operating system point of view, the process is divided into system processes and user processes two categories.

Process creation: PID =fork ()

Revocation of Process: exit (status)

See here, you may be confused about the process and the program, but it doesn't matter, and finally the process and the relationship between the program and the difference to explain:

Contact: A program is an integral part of the process, and the purpose of the process exists is to execute its corresponding program. Without a program, the process has no meaning.

Difference: 1. The program is static, while the process is dynamic.

2. The program can be written on paper or stored on a certain medium, and the process has a life cycle, created after the existence, revocation and extinction.

3. A program can correspond to multiple processes, but one process can only correspond to one program. In addition, multiple executions of a program correspond to different processes, respectively.

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.