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: 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Sat, Jul 6, 2013 at 2:59 AM, Steven D'Aprano 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