Process identifier of Process Control

Source: Internet
Author: User

Each process has a unique process ID represented by a non-negative integer. Although it is unique, the process ID can be reused (after a process is terminated, its process ID can be used again ). Most Unix systems implement latency reuse algorithms.

A process whose ID is 0 is usually a scheduling process, which is often called a Swapper ). This process is a part of the kernel. It does not execute any program on the disk and is also called a system process.

Id 1 is usually the INIT process, which is called by the kernel at the end of the Self-lifting process. This process starts a UNIX system after the bootstrap kernel. Init usually reads system-related Initialization Files (/etc/rc * file or/etc/inittab file, and/etc/init. d), and direct the system to a State (for example, multiple users ). Init is not always terminated, and it is a common user process, not a system process in the kernel process.

A process with ID 2 is a page daemon of Some UNIX systems and is responsible for supporting paging operations on the virtual storage system.

# Include <unistd. h>

Pid_t getpid (void); // obtain the ID of the process called.

Pid_t getppid (void); // obtain the parent process ID of the calling Process

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.