linux进程号是几位数,Linux 进程 PID 编号最大为多少

5a5699ebe0859228ed2328d3ea095380.gif

问题中提到,通过提问者的测试(Ubuntu18.04操作系统下),Python脚本实现的分配进行pid脚本,渠道系统自动分配给进程的最大pid值是131070,这是一个并不特殊的值。(通常可以想到的上限会是与二进制数字相关,例如1024,65536等等)。

很高兴,看到还是有很多人在坚持知乎的本来精神,先问是不是,再问为什么。

Linux 内核的进程 PID 最大值并非 131070,而是 32768 (32 位系统)和 2 的 22 次方(64 位系统)。这是Linux手册中明确给出的说明:

/proc/sys/kernel/pid_max (since Linux 2.5.34)

This file specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the maximum PID). PIDs greater than this value are not allocated; thus, the value in this file also acts as a system-wide limit on the total number of processes and threads. The default value for this file, 32768, results in the same range of PIDs as on earlier kernels. On 32-bit platforms,

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值