You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New comers might think that a True value returned from pid_exists() is a reliable value.
But of course it is not.
Few milliseconds later the process could already have terminated.
You can only trust the result "this process has terminated". The result "this process is still alive" only matches the past, not the current situation.
I am not a native speaker. That's why I hesitate to create a pull request. I think your wording would be easier to understand.
The text was updated successfully, but these errors were encountered:
Both pid_exists() and instantiating Processes by by iterating over pids() is inherently racy. The doc already mentions that discouraging the use of pids() in favor of process_iter(). It doesn't mention the racy nature of pid_exists() specifically because I think it should be clear already.
PS - I'm also a non-native speaker btw (I'm Italian). =)
Docs of pid_exists() could get improved:
https://psutil.readthedocs.io/en/latest/#psutil.pid_exists
New comers might think that a True value returned from pid_exists() is a reliable value.
But of course it is not.
Few milliseconds later the process could already have terminated.
You can only trust the result "this process has terminated". The result "this process is still alive" only matches the past, not the current situation.
I am not a native speaker. That's why I hesitate to create a pull request. I think your wording would be easier to understand.
The text was updated successfully, but these errors were encountered: