which situations should we use thread. join() ?

Discussion in 'Python' started by iMath, Feb 8, 2013.

  1. iMath

    iMath Guest

    iMath, Feb 8, 2013
    #1
    1. Advertising

  2. On Fri, Feb 8, 2013 at 3:32 PM, iMath <> wrote:
    > which situations should we use thread. join() ?
    > http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/
    > why do we not put thread. join() in this code ?


    I've no idea why you don't put thread.join() in that code. Maybe
    because it isn't needed, maybe because someone likes to live on the
    edge, maybe it's not so much "the edge" as positively cloud cuckoo
    land. When should you use it? When you want to accomplish what the
    function does, the details of which can be found in the Fine Manual.
    Actually, you probably know already what it does, or you wouldn't even
    be asking.

    ChrisA
     
    Chris Angelico, Feb 8, 2013
    #2
    1. Advertising

  3. Am 08.02.2013 07:29, schrieb Chris Angelico:
    > On Fri, Feb 8, 2013 at 3:32 PM, iMath <> wrote:
    >> which situations should we use thread. join() ?
    >> http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/
    >> why do we not put thread. join() in this code ?

    >
    > I've no idea why you don't put thread.join() in that code. Maybe
    > because it isn't needed, maybe because someone likes to live on the
    > edge, maybe it's not so much "the edge" as positively cloud cuckoo
    > land. When should you use it? When you want to accomplish what the
    > function does, the details of which can be found in the Fine Manual.
    > Actually, you probably know already what it does, or you wouldn't even
    > be asking.


    It isn't needed. I personally would prefer an explicit join(), but
    according to the documentation, "The entire Python program exits when no
    alive non-daemon threads are left.". In other words, the initial thread
    is not special and the interpreter will implicitly join() all non-daemon
    threads.

    Which again makes me want to find out in what thread's context the
    atexit call is made...

    Uli
     
    Ulrich Eckhardt, Feb 8, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFuaWVsIFdhbHplbmJhY2g=?=

    How to handle save situations in asp.net?

    =?Utf-8?B?RGFuaWVsIFdhbHplbmJhY2g=?=, Jul 21, 2004, in forum: ASP .Net
    Replies:
    12
    Views:
    983
    Steven Cheng[MSFT]
    Jul 27, 2004
  2. DigHazuse

    Validation on all PostBack situations

    DigHazuse, Nov 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    372
    DigHazuse
    Nov 29, 2005
  3. max
    Replies:
    11
    Views:
    619
    freemont
    Nov 11, 2006
  4. apalopohapa
    Replies:
    0
    Views:
    579
    apalopohapa
    Oct 20, 2009
  5. sarika
    Replies:
    4
    Views:
    83
    David Mark
    Feb 23, 2008
Loading...

Share This Page