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

是否按顺序在linux中分配了进程ID?,第1张

概述如果某个程序的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 risin 如果某个程序的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

总结

以上是内存溢出为你收集整理的是否按顺序在linux中分配了进程ID?全部内容,希望文章能够帮你解决是否按顺序在linux中分配了进程ID?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1025153.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存