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


Groups > comp.lang.python > #26313

Re: Pass data to a subprocess

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 <andrea.crotti.0@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.092
X-Spam-Evidence '*H*': 0.82; '*S*': 0.00; 'structure,': 0.09; 'def': 0.10; 'to:name:python-list': 0.15; 'add,': 0.16; 'header:In-Reply- To:1': 0.25; 'mix': 0.27; 'message-id:@mail.gmail.com': 0.27; 'running': 0.32; 'subject:data': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; "won't": 0.35; 'received:209.85': 0.35; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'think': 0.40; 'safe': 0.63; 'start.': 0.84
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=Hm2Uk+CZ1Q1cfXFlgPikAQv1Tyzef6LBmzFcEIF5f/g=; b=GrE5Anltz4eLfZwEUjtUjTa7FvLafVvppavD5eMyBkB8SquI6vSeRVL/mEpUZHv1SB sxum0hT9sJbZtd8sXP/LGFgg4wvvtUT9gWJ6+Rd61VceBkrK4Sjipkfm+nFkcPfSZrlg ujN80zYB/G6lV7RMDy2xMDFqlzEkpMrSnO7abFjJ9IWQjpg+dHN8fCfIe5PzLEuaTeHK SjLodf/4DTBUTmKg0m70KyV4DZYDk66l89XP/zJrfN+0S5L2GYl/xqmcDhWFl2YH3aXd o3ZzoDb5tikx7YyuCEsevazd+vK4LiDGTXQGZSxU5OLZUQhWFZ1czlHrNjqAR8neKDJL tWRA==
MIME-Version 1.0
In-Reply-To <CAF_E5JY5FgEJub7tNNzZEj0tri8Z7oPZUSLOLtD+5f0t7Yv+Yg@mail.gmail.com>
References <CAF_E5JY5FgEJub7tNNzZEj0tri8Z7oPZUSLOLtD+5f0t7Yv+Yg@mail.gmail.com>
Date Tue, 31 Jul 2012 15:12:22 +0100
Subject Re: Pass data to a subprocess
From andrea crotti <andrea.crotti.0@gmail.com>
To python-list <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.2783.1343743945.4697.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1343743945 news.xs4all.nl 6975 [2001:888:2000:d::a6]:38276
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:26313

Show key headers only | View raw


>
>
> def procs():
>     mp = MyProcess()
>     # with the join we are actually waiting for the end of the running time
>     mp.add([1,2,3])
>     mp.start()
>     mp.add([2,3,4])
>     mp.join()
>     print(mp)
>

I think I got it now, if I already just mix the start before another
add, inside the Process.run it won't see the new data that has been
added after the start.

So this way is perfectly safe only until the process is launched, if
it's running I need to use some multiprocess-aware data structure, is
that correct?

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


Thread

Re: Pass data to a subprocess andrea crotti <andrea.crotti.0@gmail.com> - 2012-07-31 15:12 +0100

csiph-web