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


Groups > comp.lang.python > #50004

Re: How to check for threads being finished?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.133
X-Spam-Level *
X-Spam-Evidence '*H*': 0.78; '*S*': 0.04; 'subject:How': 0.10; 'thread': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:threads': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'module,': 0.24; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; "can't": 0.35; 'received:google.com': 0.35; 'there': 0.35; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'simply': 0.61; 'jul': 0.74; 'done:': 0.84; 'subject:being': 0.84; 'subject:check': 0.84; '2013': 0.98
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=1LVEXZUmOk1w6Z6zDINqO7ugjNuY8FukdmkjXM93Co0=; b=EXhurGytz9siIHEtxGLJJpZQcMd8V4/RRz1mLY9EriIgc8hweOA51foG8rwGVTepkm VGioFx5PJx7VmBSovRbXcJXbA8nHYl3EkUCOvARX5WJNEid+bGJTHAU/QGAJeCDEC8Ov QRLVphVuP43UsB+9ia/uPo2Rvm3nySsi+l4uvGJZuEVGwuQ0TGYBefM6Gvy0duqVn3J8 8/lJUIdNiBgYfLQkilJlRgVSGif1ojwWvx771ASHcetLtEn7uVlOlm31VdmS6MU9hdPV dHL1NLgaPuCxVf2/apdvQeMq0J03xM0I6heXqdMFMeLfhDwcNG1GgMJVra1YoLTkGnVP YzEw==
MIME-Version 1.0
X-Received by 10.52.120.77 with SMTP id la13mr6299713vdb.23.1373044269617; Fri, 05 Jul 2013 10:11:09 -0700 (PDT)
In-Reply-To <51d6fb8a$0$29999$c3e8da3$5496439d@news.astraweb.com>
References <51d6fb8a$0$29999$c3e8da3$5496439d@news.astraweb.com>
Date Sat, 6 Jul 2013 03:11:09 +1000
Subject Re: How to check for threads being finished?
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.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.4304.1373044272.3114.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1373044272 news.xs4all.nl 15919 [2001:888:2000:d::a6]:40251
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:50004

Show key headers only | View raw


On Sat, Jul 6, 2013 at 2:59 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> I then block until the threads are all done:
>
> while any(t.isAlive() for t in threads):
>     pass
>

Using the threading module, I assume. Is there any reason you can't
simply join() each thread in succession?

ChrisA

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


Thread

How to check for threads being finished? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-05 16:59 +0000
  Re: How to check for threads being finished? Chris Angelico <rosuav@gmail.com> - 2013-07-06 03:11 +1000
  Re: How to check for threads being finished? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2013-07-05 19:12 +0200
    Re: How to check for threads being finished? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-06 02:18 +0000
    Re: How to check for threads being finished? Stefan Behnel <stefan_ml@behnel.de> - 2013-07-06 10:49 +0200
  Re: How to check for threads being finished? Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-05 11:18 -0600
  Re: How to check for threads being finished? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-07-05 16:13 -0400
  Re: How to check for threads being finished? Cameron Simpson <cs@zip.com.au> - 2013-07-06 10:45 +1000

csiph-web