Linux Process running status chart

Source: Internet
Author: User

 

 

 

◆ Running status (task_running)
When the process is being executed by the CPU or is ready for scheduling at any timeProgramThe process is running ). Processes can run in kernel or user mode. When system resources are available, the process is awakened and enters the ready state. This state is called the ready state. These statuses (the middle column in the figure) indicate the same method in the kernel and are all in the task_running status.

◆ Interrupted sleep (task_interruptible)
When a process is in an interrupted wait state, the system does not schedule this operation. When the system interrupts or releases the resources that the process is waiting for, or the process receives a signal, it can wake up the process to the ready state (running state ).

◆ Paused (task_stopped)
When the process receives the signal sigstop, sigtstp, sigttin or sigttou, it enters the pause state. You can send a sigcont signal to it to convert the process to a running state.

◆ Zombie status (task_zombie)
When the process has stopped running, but its parent process has not asked about its status, it is said that the process is in a dead state.

◆ Uninterrupted sleep (task_uninterruptible)
The sleep state is similar to that of an interrupted sleep. However, a process in this status can be switched to a ready state to run only when it is explicitly awakened using the wake_up () function.

 

When a process runs out of time slices, the system will use the scheduler to forcibly switch to other processes for execution. In addition, if a process needs to wait for a system resource during kernel state execution, the process will call
Sleep_on () or sleep_on_interruptible () voluntarily waives the CPU usage right and allows the scheduler to execute other processes. The process goes to sleep state.
Status (task_uninterruptible or task_interruptible ).

The kernel will switch the process only when the process is transferred from the "kernel running state" to "sleep state. Processes running in the kernel state cannot be preemptible by other processes, and one process cannot change the status of another process. To avoid kernel data errors during process switching, the kernel runs the critical sectionCodeAll interruptions are prohibited.

 

 

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.