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


Groups > comp.lang.python > #52272

Re: Python3 Multiprocessing

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <devyncjohnson@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.044
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'mrab': 0.05; 'collier': 0.09; 'subject:Python3': 0.09; 'threads.': 0.16; 'wrote:': 0.18; 'command': 0.22; 'header:User-Agent:1': 0.23; 'instance,': 0.24; 'script': 0.25; 'possibly': 0.26; 'this:': 0.26; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'received:10.0.0': 0.31; 'skip:m 30': 0.32; 'created': 0.35; 'something': 0.35; 'johnson': 0.35; 'received:google.com': 0.35; 'complete.': 0.36; 'thanks': 0.36; 'possible': 0.36; 'received:10.0': 0.36; 'two': 0.37; 'received:10': 0.37; 'actions': 0.38; 'depends': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'email addr:gmail.com': 0.63; 'kind': 0.63; 'subject:skip:M 10': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=uUwEkrY+2T3K7Vexa+17lMKkmPMWgstf8Z3sSGAQn+A=; b=QJSqG1DYlo4gvXpTO09FRFIQ23VPWugzxZntMDJcXTvwLhkIFQJY7VMExUYPR6Lxpa j4tZPGHAjB8DJRmibEIagVQZKNWGdqzSIYJndRhIIVgvergBI0IwLKprv/NYTP/EAK7T oqQbMB6i4fcyFuXo8ZLm3lPjnd8iOBfOj+SDWvIPDK02TGzWSo5PkzTshHuZkFja26yf FvM+1Y5fXn36IJorPx7eF2lGWJ2sO4WtrgSE1aq3aTNPQtU4d2X2wtiaZpBdV/dHi4M+ bTk5TSUUvR+sAXLTPnScduK/U2RwKn5LIlbeATWClwYRkqmZm2dxfNWC7ZoDsxCZiTQ4 pQnA==
X-Received by 10.60.15.106 with SMTP id w10mr1989663oec.82.1376081019353; Fri, 09 Aug 2013 13:43:39 -0700 (PDT)
Date Fri, 09 Aug 2013 16:43:36 -0400
From Devyn Collier Johnson <devyncjohnson@gmail.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8
MIME-Version 1.0
To python-list@python.org
Subject Re: Python3 Multiprocessing
References <5205435D.5090704@Gmail.com> <520546A2.50900@mrabarnett.plus.com>
In-Reply-To <520546A2.50900@mrabarnett.plus.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.407.1376081022.1251.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1376081022 news.xs4all.nl 15929 [2001:888:2000:d::a6]:38982
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52272

Show key headers only | View raw


On 08/09/2013 03:44 PM, MRAB wrote:
> On 09/08/2013 20:30, Devyn Collier Johnson wrote:
>> Aloha!
>>
>>      I need a command that will make threads created by
>> "multiprocessing.Process()" wait for each other to complete. For
>> instance, I want to do something like this:
>>
>> job1 = multiprocessing.Process(CMD1())
>> job2 = multiprocessing.Process(CMD2())
>>
>> jobs1.start(); jobs2.start()
>>
>> PY_FUNC()
>>
>> The command "PY_FUNC()" depends on the end result of the actions of
>> CMD1() and CMD2(). I need some kind of wait command for the two threads
>> that will not let the script continue until job1 and job2 are complete.
>> Is this possible in Python3?
>>
> Possibly you mean .join:
>
> jobs1.start()
> jobs2.start()
>
> jobs1.join()
> jobs2.join()
>

Thanks MRAB! That is easy. I always (incorrectly) thought the join() 
command got two threads and made them one. I did not know it made the 
script wait for the threads.

Mahalo,

DevynCJohnson@Gmail.com

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


Thread

Re: Python3 Multiprocessing Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-09 16:43 -0400

csiph-web