[Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446) (original) (raw)
Richard Oudkerk shibturn at gmail.com
Wed Jul 24 20:36:48 CEST 2013
- Previous message: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)
- Next message: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)
- Next message: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]