STINNER Victor <vstin...@python.org> added the comment:

> To further elaborate on the creation time solution, the idea in pseudo-code 
> is the following: (...)
> Technically there is still a race condition between _execute_child() and 
> get_create_time(), but: (...)

Even if the approach seems to be different, PR 16984 seems to have the same 
advantages and drawbacks.

PR 16984 rely on the fact that the Linux kernel doesn't use a pid until its 
parent calls os.waitpid(). Even if the child process completed, the pid remains 
assigned (and the process status is "zombie").

PR 16984 has the advantage that it reuses existing code which has been battle 
tested: we are sure that the code is portable and works well.

Whereas get_create_time() will be likely platform specific and will add a 
little maintenance burden.

I know that PR 16984 is a partial solution (there is still a race condition if 
waitpid() is called directly, without using the Popen API), but I don't see a 
strong reason to prefer get_create_time().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38630>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to