STINNER Victor <[email protected]> added the comment:
I'm discussing with Pablo to see how to use posix_spawn() in the Python
subprocess module. IMHO we should consider the specific case of subprocess.
What is the expected API?
kw = {}
if hasattr(os, 'POSIX_SPAWN_USEVFORK'):
kw['flags'] = os.POSIX_SPAWN_USEVFORK
posix_spawn(*args, **kw)
or
posix_spawn(*args, use_vfork=True)
or
kw = {}
if sys.platform == 'linux':
kw['use_vfork'] = True
posix_spawn(*args, **kw)
?
For example, if we consider that it's safe to use POSIX_SPAWN_USEVFORK in all
cases for posix_spawn(), maybe we should not add an option at the Python level,
and hardcode the POSIX_SPAWN_USEVFORK flag in the C code?
--
> if I read the code correctly POSIX_SPAWN_USEVFORK is no longer used in the
> implementation of posix_spawn(3))
Ok, now I'm confused: what's the point of this issue if the flag became
useless? :-)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34663>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com