Home  >  Article  >  What is the difference between program and process?

What is the difference between program and process?

青灯夜游
青灯夜游Original
2020-12-07 16:28:3722131browse

Difference: A program is just an ordered collection of instructions. It itself has no meaning of running. It is just a static entity. A process is different. It is the execution of a program on a certain data set. A process is a dynamic entity with its own life cycle. The process has concurrency and communication, which is different from the closed nature of the program.

What is the difference between program and process?

#The operating environment of this article: Windows 7 system, Dell G3 computer.

Related recommendations: " Programming Learning Website"

Program

A computer program is a set of programs that a computer can recognize and execute Instructions are information tools that run on electronic computers to meet certain needs of people.

It is written in some programming languages ​​and runs on some target architecture. For example, a program is like an article written in English (programming language). It needs to be read, understood, and marked by a person who understands English (compiler) and who can also read this article (structure system). article. Generally, computer programs based on English text must be compiled and linked into a digital format that is difficult for humans to interpret but can be easily interpreted by computers, and then put into operation.

A program is a sequence of instructions.

Process

A process (Process) is a running activity of a program in a computer on a certain data set. It is the basic unit for resource allocation and scheduling in the system. The basis of operating system architecture. In the early process-oriented computer architecture, the process was the basic execution entity of the program; in the contemporary thread-oriented computer architecture, the process is the container of threads. A program is a description of instructions, data and their organization, and a process is the entity of the program.

The difference and connection between program and process

1). A program is just an ordered collection of instructions. It itself has no meaning of running. It is just a static entity. A process is different. It is the execution of a program on a certain data set. A process is a dynamic entity with its own life cycle. It is generated due to creation, run due to scheduling, placed in a waiting state due to waiting for resources or events, and canceled due to completion of tasks. A process reflects the entire dynamic process of a program running on a certain data set.

2) There is no one-to-one correspondence between processes and programs. A program becomes a different process when executed on different data sets. You can use a process control block to uniquely identify each process. This is something that a program cannot do. Since the program has no direct connection with the data, even if it is a program that executes different data, their set of instructions is still the same, so it is impossible to uniquely identify these programs running on the data. program on different data sets. Generally speaking, a process must have one corresponding program, and there is only one. A program may not have a corresponding process (because it is not executed), or it may have multiple processes corresponding to it (running on several different data sets).

3) The process also has concurrency and interaction, which is also different from the closed nature of the program.

If you want to read more related articles, please visit PHP Chinese website! !

The above is the detailed content of What is the difference between program and process?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What platform is cctalk?Next article:What platform is cctalk?