Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68709

Re: Implement multiprocessing without inheriting parent file handle

From Mark H Harris <harrismh777@gmail.com>
Newsgroups comp.lang.python
Subject Re: Implement multiprocessing without inheriting parent file handle
Date 2014-03-21 13:16 -0500
Organization Aioe.org NNTP Server
Message-ID <lghvlr$bqs$1@speranza.aioe.org> (permalink)
References <mailman.8363.1395415712.18130.python-list@python.org> <878us35tz8.fsf@elektro.pacujo.net>

Show all headers | View raw


On 3/21/14 12:42 PM, Marko Rauhamaa wrote:
>    http://docs.python.org/3/library/subprocess.html#popen-constructor>

> It's got the optional close_fds parameter, which is True by default.

> IOW, you don't need to do anything if you use subprocess.Popen() to
> start your child process. Incidentally, that's the preferred way.

hi Marko, of course this depends on the environment; if unix-like, then 
yes, elif windows well, not so much...

There are caveats about stdin, stdout, and stderr;  as well, there are 
caveats about passing fds between the two. Well, Popen() is implemented 
on unix and windows differently, so there is some study needed here if 
code is going to be run in both environments.

marcus

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Implement multiprocessing without inheriting parent file handle Antony Joseph <antonyjoseph89@gmail.com> - 2014-03-21 20:58 +0530
  Re: Implement multiprocessing without inheriting parent file handle Mark H Harris <harrismh777@gmail.com> - 2014-03-21 12:25 -0500
  Re: Implement multiprocessing without inheriting parent file handle Grant Edwards <invalid@invalid.invalid> - 2014-03-21 17:37 +0000
  Re: Implement multiprocessing without inheriting parent file handle Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 19:42 +0200
    Re: Implement multiprocessing without inheriting parent file handle Mark H Harris <harrismh777@gmail.com> - 2014-03-21 13:16 -0500
      Re: Implement multiprocessing without inheriting parent file handle Chris Angelico <rosuav@gmail.com> - 2014-03-22 09:50 +1100

csiph-web