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


Groups > comp.lang.python > #12684

Re: Why doesn't threading.join() return a value?

From Chris Torek <nospam@torek.net>
Newsgroups comp.lang.python
Subject Re: Why doesn't threading.join() return a value?
Date 2011-09-03 01:04 +0000
Organization None of the Above
Message-ID <j3rueg0kkm@news4.newsguy.com> (permalink)
References <61044fa5-2850-4f05-a55a-d61521c74313@d7g2000vbv.googlegroups.com> <5da6bf87-9412-46c4-ad32-f8337d56b2c3@o15g2000vbe.googlegroups.com> <roy-030914.19162802092011@news.panix.com>

Show all headers | View raw


In article <roy-030914.19162802092011@news.panix.com>
Roy Smith  <roy@panix.com> wrote:
>Thread.join() currently returns None, so there's 
>no chance for [return value] confusion.

Well, still some actually.  If you use my example code (posted
elsethread), you need to know:

  - that there was a target function (my default return
    value if there is none is None); and
  - that the joined thread really did finish (if you pass
    a timeout value, rather than None, and the join times
    out, the return value is again None).

Of course, if your target function always exists and never returns
None, *then* there's no chance for confusion. :-)
-- 
In-Real-Life: Chris Torek, Wind River Systems
Intel require I note that my opinions are not those of WRS or Intel
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W)  +1 801 277 2603
email: gmail (figure it out)      http://web.torek.net/torek/index.html

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


Thread

Why doesn't threading.join() return a value? Roy Smith <roy@panix.com> - 2011-09-02 07:53 -0700
  Re: Why doesn't threading.join() return a value? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-03 01:45 +1000
    Re: Why doesn't threading.join() return a value? Seebs <usenet-nospam@seebs.net> - 2011-09-02 16:42 +0000
      Re: Why doesn't threading.join() return a value? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-03 06:49 +1000
  Re: Why doesn't threading.join() return a value? Adam Skutt <askutt@gmail.com> - 2011-09-02 11:01 -0700
    Re: Why doesn't threading.join() return a value? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-09-02 20:23 +0200
      Re: Why doesn't threading.join() return a value? Adam Skutt <askutt@gmail.com> - 2011-09-02 11:53 -0700
        Re: Why doesn't threading.join() return a value? Chris Torek <nospam@torek.net> - 2011-09-02 20:14 +0000
          Re: Why doesn't threading.join() return a value? Adam Skutt <askutt@gmail.com> - 2011-09-02 15:02 -0700
          Re: Why doesn't threading.join() return a value? Roy Smith <roy@panix.com> - 2011-09-03 12:51 -0400
        Re: Why doesn't threading.join() return a value? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-09-03 10:33 +0200
          Re: Why doesn't threading.join() return a value? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-09-03 11:00 +0200
        Re: Why doesn't threading.join() return a value? Carl Banks <pavlovevidence@gmail.com> - 2011-09-03 05:27 -0700
    Re: Why doesn't threading.join() return a value? Roy Smith <roy@panix.com> - 2011-09-02 19:16 -0400
      Re: Why doesn't threading.join() return a value? Chris Torek <nospam@torek.net> - 2011-09-03 01:04 +0000
    Re: Why doesn't threading.join() return a value? Carl Banks <pavlovevidence@gmail.com> - 2011-09-03 05:04 -0700

csiph-web