On 24/07/2013 7:17pm, Guido van Rossum wrote:
> Does it also inherit sockets (which take up a different namespace than
> regular FDs in CRT, unlike UNIX)?

Not reliably. Processes created with CreateProcess() seems to inherit socket handles just like normal handles on my computer, but on some other computers -- with the same Windows version! -- it appears not to work. See http://bugs.python.org/issue17399.

I think WSADuplicateSocket() should be used instead.

> And if we default individual handles to uninheritable, we can
> presumably fix the ones that multiprocessing creates with the express
> purpose of being inherited easily. (If it even uses that -- I haven't
> read the source code, maybe it uses named pipes?

multiprocessing never really needs to create any inheritable handles: it can use DuplicateHandle() to transfer each handle directly to the child process.

--
Richard

_______________________________________________
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