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


Groups > comp.lang.python > #25657

Re: Let child process to run while parent is out (multiprocessing)

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'output': 0.04; 'though:': 0.07; 'python': 0.09; 'subject:process': 0.09; 'subject:skip:m 10': 0.09; 'subject:while': 0.09; 'windows,': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hangs': 0.16; 'parentheses': 0.16; 'received:209.85.161.174': 0.16; 'seconds.': 0.16; 'subject:run': 0.16; 'wrote:': 0.17; 'putting': 0.20; 'trying': 0.21; 'do.': 0.21; 'linux': 0.24; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; '2.6': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'lines': 0.28; 'probably': 0.29; "i'm": 0.29; 'fri,': 0.30; 'code': 0.31; 'docs': 0.33; 'to:addr:python-list': 0.33; 'produced': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'anything': 0.36; 'subject: (': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'supports': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'build': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'john': 0.60; 'side': 0.61; 'truly': 0.62; 'show': 0.63; 'here': 0.65; '20,': 0.65; 'jul': 0.65; 'answer.': 0.71; 'hoping': 0.72; 'delaying': 0.84; 'obvious,': 0.91; 'subject:Let': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oERqJO66qwhaolkM91oB3IIE7KFRimx5SZQYxWEd29c=; b=s4D4Z+6ygeJS+MJ8VNaHFox6mlKYk8kdcfRyb8WQryn9WUXnSbWMCtjJTRRTSQYfdn kTvjsq1CLTGWneSg1xJLMri6yQ0wDRQmRNhZWIB5tkCk0KETHMZLy6TxAjzCV83THac2 qF4GZdyigpPHDUQdYkYvp8rgf3k/fozI6JV8o5/ftFCA+nyB7nN6Dl+p++gTRtc6ciRP /9fjaaeZJb7nIqLRoMpjk/FTDwM/5WPT/oMd6jsHbCq49aWqtswxojILP9IneNcQJVy6 cufTCQHPpT7O8TbBqhMiLHhKKcuI4+UaWgSa2gtgBKpqnSF0q+jtzFbqPnK59dNH2CZs 30Ug==
MIME-Version 1.0
In-Reply-To <CACCLA54K9HV1qPhuT2i_dSjUk+ey3TdFN2+9x8_3Aay7de3Snw@mail.gmail.com>
References <CACCLA54K9HV1qPhuT2i_dSjUk+ey3TdFN2+9x8_3Aay7de3Snw@mail.gmail.com>
Date Fri, 20 Jul 2012 09:05:11 +1000
Subject Re: Let child process to run while parent is out (multiprocessing)
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2322.1342739114.4697.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1342739114 news.xs4all.nl 6926 [2001:888:2000:d::a6]:59411
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25657

Show key headers only | View raw


On Fri, Jul 20, 2012 at 6:34 AM, John Wong <gokoproject@gmail.com> wrote:
> Here is output:
> yeukhon@fermat:~$ python c2.py
> abcd12345
> done  [now hangs for 10 seconds]
> I build things

Side point: I just tried your code on Python 2.6 on Windows, and it
produced all three lines of output before waiting the ten seconds.
Same in Python 3.3 on Linux (after putting parentheses around the
prints, the only 2->3 change needed). Your experience of it delaying
the "building" message probably has something to do with output
buffering.

As to the fundamental, though: I don't know that Python truly supports
what you're trying to do. A skim of the docs doesn't show up anything
obvious, so I'm hoping that someone else has already tried this and
can give an authoritative or empirical answer.

ChrisA

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


Thread

Re: Let child process to run while parent is out (multiprocessing) Chris Angelico <rosuav@gmail.com> - 2012-07-20 09:05 +1000

csiph-web