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

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

相关文章

/etc/sysctl.conf这个目录主要是配置一些系统信息,/etc/sys...
1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起...
它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅...
不管是我们在安装软件还是监测软件的使用性能,我们都要随时...
装好Tomcat7后,发现除了本机能访问外界访问不了,岂有此理。...
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,...