threading.Thread.join(timeout=...) considered unreliable

Dennis Lee Bieber wlfraed at ix.netcom.com
Tue Oct 15 03:18:26 EDT 2002


Dennis Lee Bieber fed this fish to the penguins on Monday 14 October 
2002 10:15 pm:

        Talking to myself, just to add a bit of closure...

>         At this point in time, it's using over 50% of my CPU, and has
>         been
> running for 17 minutes! Main program just doing nothing but waiting
> for the unkillable thread to finish.
>
        It eventually finished 

Thread-4  rcall waiting 1.07705593109
Thread-1  returned 11 1.42109394073
Thread-2  returned 9 1.82807445526
Thread-4  Running func 2.53200531006
Thread-3  returned 1 46.63002491
Thread-4  join expired 505.463004112
Queue is empty
TimeOut
505.625009537




Thread-4  returned 1 1823014.20105
[wulfraed at beastie wulfraed]$

        So the timeout worked, in 505msec, but the computation thread itself 
didn't finish until 1,823,014msec had elapsed (or half an hour!)

        If nothing else, the threading module definitely needs some sort of 
thread.kill(), even if all it does is trigger an exception inside the 
thread. Then, in the above example, once the join(time) timed out, a 
kill could be issued...

-- 
--  
 > ============================================================== <
 >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <



More information about the Python-list mailing list