I'm doing some simulation work with Linux, and the code I'm working on right now only works under the assumption that, once a process has been assigned a PID by the kernel, that PID will remain the same until the process is killed. I would assume this is true but since I'm kind of new to the Linux world I just want to see if there are any special circumstances I ought to be aware of. Thanks!
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
Yes, it's guaranteed. Process will have the same PID even if its image will be replaced with another one by exec system call. |
|||||||||
|
|
Well...mostly. As other posters have said any particular process will retain it's PID indefinitely. Even through one or more instances of However, a programmer who wished to evade that guarantee on a unix box would have no trouble at all. He would simple |
|||
|
|