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


Groups > comp.lang.python > #68705

Re: Implement multiprocessing without inheriting parent file handle

From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: Implement multiprocessing without inheriting parent file handle
Date 2014-03-21 19:42 +0200
Organization A noiseless patient Spider
Message-ID <878us35tz8.fsf@elektro.pacujo.net> (permalink)
References <mailman.8363.1395415712.18130.python-list@python.org>

Show all headers | View raw


Antony Joseph <antonyjoseph89@gmail.com>:

> How can i implement multiprocessing without inherit file descriptors
> from my parent process?

Take a look at the subprocess module:

  <URL:
  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.


Marko

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