Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Explain the value range of pid in linux system in detail.

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

General PID_MAX=0x8000 (changeable), so the maximum value of the process number is 0x7fff, that is, 32767.

The process number 0299 is reserved for the daemon process.

The current kernel does not seem to have this restriction. "linux Kernel Design and implementation" says that in order to be compatible with older versions of unix and linux, the maximum value of pid is 32767 by default (the maximum value of short int). If you need to, you can not consider compatibility with the old version, modify / proc/sys/kernel/pid_max to increase the upper limit and use echo to rewrite a value to this file.

Since it is impossible for ordinary machines to run so many processes + threads at the same time, 32768 is certainly enough, but the system tends to allocate unused pid to new processes, so you will find that on running systems, there are many low-level pid that are not used, that is because the pid has been used by other programs at startup, of course, you really have the ability to use the maximum value of pid, and the system also has a way to solve it. That is to start from scratch (low order) to search for unoccupied pid assigned to the new process.

Summary

The above is the value range of pid under the linux system introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report