Home  >  Article  >  What does process control include?

What does process control include?

藏色散人
藏色散人Original
2020-06-30 09:11:423655browse

Flow control is also called control flow. It is a term in the field of computer operations. Its content includes the order of individual instructions or statements, subroutine running or evaluation when the program is running, whether in a declarative form. There are similar concepts in programming languages ​​or functional programming languages.

What does process control include?

Control flow (also known as flow control) is a term in the field of computer operations, which means that when a program is running, individual instructions (or statements, subscripts) The order in which a program) is run or evaluated. Whether in declarative programming languages ​​or functional programming languages, there are similar concepts.

Basic concepts

In declarative programming languages, flow control instructions refer to instructions that will change the running order of the program, which may run at different locations. command, or select one of the two (or multi-section) programs to run.

The process control instructions provided by different programming languages ​​will also be different, but they can generally be divided into the following four types:

  • Continue to run at different positions A block of instructions (unconditional branch instructions).

  • If a specific condition is true, run an instruction, such as the switch instruction in C language, which is a conditional branch instruction.

  • Run an instruction several times until a specific condition is established. For example, the for instruction in C language can still be regarded as a conditional branch instruction.

  • Run a section of instructions located at different locations, but after completion, it will continue to run the original instructions to be run, including subroutines, coroutines and continuations.

  • Stop the program without running any instructions (unconditional termination).

Lower-level mechanisms such as interrupts and signals in Unix systems can also produce subroutine-like effects, but usually such mechanisms are used to respond to external events or inputs. Program self-modification will also affect the control flow due to its impact on the code, but most of them will not have obvious flow control instructions.

In machine language or assembly language, flow control is achieved by modifying the program counter value. Some CPUs only support conditional branches or unconditional branches (sometimes called jumps).

The above is the detailed content of What does process control include?. 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