加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

是否按顺序在linux中分配了进程ID?

发布时间:2020-12-14 00:53:31 所属栏目:Linux 来源:网络整理
导读:如果某个程序的pid为p,那么子进程(及其子进程)是否会有pid严格大于P? 当重复使用pid时,选择哪种pid,例如是最低的pid? 解决方法 从 http://en.wikipedia.org/wiki/Process_identifier起 Process IDs are usually allocated on a sequential basis,beginning
如果某个程序的pid为p,那么子进程(及其子进程)是否会有pid严格大于P?

当重复使用pid时,选择哪种pid,例如是最低的pid?

解决方法

从 http://en.wikipedia.org/wiki/Process_identifier起

Process IDs are usually allocated on a sequential basis,beginning at
0 and rising to a maximum value which varies from system to system.
Once this limit is reached,allocation restarts at 300 and again
increases. In Mac OS X and HP-UX,allocation restarts at 100. However,
for this and subsequent passes any PIDs still assigned to processes
are skipped. Some consider this to be a potential security
vulnerability in that it allows information about the system to be
extracted,or messages to be covertly passed between processes. As
such,implementations that are particularly concerned about security
may choose a different method of PID assignment.[1] On some systems,
like MPE/iX,the lowest available PID is used,sometimes in an effort
to minimize the number of process information kernel pages in memory.

原始答案:https://superuser.com/questions/135007/how-are-pids-generated

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读