2013/7/24 Richard Oudkerk <shibt...@gmail.com>:
>> Wow. Indeed you can -- I just tested this myself. How is this
>> accomplished? I guess the CRT has a backchannel to talk to itself when
>> it creates a process using spawn*?
>
> CreateProcess() takes a STARTUPINFO argument with undocumented fields
> cbReserved2, lpReserved2.  They are used to pass an array of fds.

So would it be possible to implement the pass_fds parameter of
subprocess using spawnl() or the undocumented fields?

And is it possible to close all handles except one (implement "pass_handles")?

The idea would be to use something subprocess.Popen(cmd,
pass_fds=[pipe_rfd], close_fds=True) or subprocess.Popen(cmd,
pass_handles=[pipe_rhandle], close_handles=True) instead of
subprocess.Popen(cmd, close_fds=False).

> In the experimental branch of multiprocessing, child processes
> no longer inherit unnecessary handles.

Where is this branch? How did you create the channel between the
manager and the worker?

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to