About the pid of the process

后端 未结 7 1815
借酒劲吻你
借酒劲吻你 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 14:55

    Depends on your platform, but you shouldn't be dependent on any specific order to your pid's.

    On Windows, pid's are usually allocated in increasing numbers, but as processes exit the pid's can be recycled and you will see cases where a newer process has a lower pid than an older process. Also, pid's come out of the same namespace as tid's, so you won't see pid's increasing by 4 as you launch new processes.

提交回复
热议问题