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

藏色散人
Release: 2023-03-16 16:48:01
forward
3710 people have browsed it

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 "'s are 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!

Related labels:
source:learnku.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template