Home>Article>Backend Development> From a programmer's perspective, what are the 3 process states?

From a programmer's perspective, what are the 3 process states?

藏色散人
藏色散人 forward
2022-07-31 14:51:48 3561browse

From the perspective of a programmer, there are three states in the process.

1. In progress

The process is running or waiting to be executed.

2. Suspend (also called stop)

Temporary suspension, such as executing sleep(), wait() functions, etc. Continue to run the process until the SIGCONT signal is received.

3. Terminate

The process has ended forever and is waiting for recycling by the parent process or has been recycled. Execute the exit function in common code, or press ctrl c under cli.

Note: Some children may think that "'sare waiting to be run in the running state"and "suspended". What is the difference?

Answer:

The suspended state is when a signal is received, such as SIGSTOP, SIGISTP, etc., and it becomes suspended state. During this period, it will not be executed by the kernel until the SIGCONT signal is received to continue executing the process. It tells the kernel brother, I am still waiting for the "SIGCONT signal" notification, and the kernel cannot schedule me yet. And "waiting to be run in the ongoing state" is the process telling the kernel brother that I am ready, and you can schedule me at any time.

Original address: https://learnku.com/articles/70147

The above is the detailed content of From a programmer's perspective, what are the 3 process states?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete