Does Windows 7 recycle process id (PID) numbers? -


I have this small test that is created and closed as a PID < P> When a window is processed, it gets a PID, but when it is done, then I am checking a problem that has received my crazy and would like to ask you about it . The process closes, does the PID retire (such as the Jersey number of Star Baskettler) or is it possible for a new, completely unrelated process under PID released?

Thanks

Yes, process ID can be recycled by the system.

Raymond Chen discussed this matter here:

The process ID is linked to a value process object, and as long as the process object is still nearby, Even then its process ID will be. The process object remains as long as the process is still running (the process is first placed in its own context) or until someone is still handled for the process object.

If you think about it then it makes sense, because as long as there is no handle for the process, wait for someone to wait for the exit to wait , Or they can call GetExitCodeProcess to get the exit code, and retrieve that exit code later to be stored anywhere.

When all the handles are closed, then the kernel knows that no one is asking whether the process is still going on or what the exit code is (because you have to ask those questions A handle is required). At which point the process object can be destroyed, which destroys the process ID.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -