About the pid of the process

后端 未结 7 1830
借酒劲吻你
借酒劲吻你 2020-12-11 14:39

I\'ve a somewhat silly question, if i have a series of processes that are created ... these are not necessarily some sort of inheritance, the pid of the processes have to be

7条回答
  •  情书的邮戳
    2020-12-11 15:02

    On Linux, pids are generally allocated sequentially on a system-wide basis, but they will wrap around periodically, and there may be 'gaps' caused by other unrelated processes. In an extreme case, you might have a 'gap' wide enough to cause this wrap-around. So don't assume any particular ordering - instead explicitly keep track of your parent or child process' PIDs.

提交回复
热议问题