Process-related content for Linux systems

Source: Internet
Author: User

First, the basic concept

1: Understand the process, we have to understand what the program is, the program is a file stored on the computer disk, and the process is a running program, it is like open QQ. A program may also consist of multiple processes that perform a number of different tasks at the same time.

2: Classification of the process

It is divided into interactive process, batch process, daemon process.

3: Status of the process

The process can be viewed through the instructions of the terminal Ps-aux which stat in the Process information table is the state of the process

O: Ready state, all preparations are done, waiting to be called.

R: Run state, Linux system does not have O status, so say O is R.

S: Can wake up sleep state, system call, get to resource or receive message can be awakened

D: Sleep states that cannot be awakened must wait for his events to come.  

  T: Paused state, received SIGSTP signal until Sigcont signal is received to continue operation

X: The state of death, the process that has ended, the final status of which can be seen through another terminal

Z: Zombie state, after the child process is not recovered by the parent process in time, the child process will become a zombie process.

<: High priority, this process takes precedence over other processes to execute first.

N: Low priority, it can be understood that the importance of this process is not high, can be executed later.

L: Multithreaded Process

S: A process that has child processes.

+: Background Process Group

4: Parent-child Process Group

If process B is open by process A, then a is the parent of B, and B is a child process.

When the child process ends, a signal sigchld is sent to the parent process, and the child process is reclaimed when the parent process receives it.

When the child process ends, the parent process is not reclaimed in time, and the child process becomes a zombie process.

When the child process ends, the parent process ends before it, and the child process becomes an orphan process and is eventually reclaimed by the Init process.

5: Process Identifier

That is, the process number, which can be obtained through the GETPID function to the unsigned integer.

This number is used in the loop, and when the process is finished, the number is not related to the process and will be reused by delay.

,

  

  

Process-related content for Linux systems

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.