Thread time-out in python

Aahz Maruch aahz at panix.com
Fri Dec 22 01:31:00 EST 2000


In article <91m3vv$hfg$1 at nnrp1.deja.com>,  <kataru1 at my-deja.com> wrote:
>
>In my application, I spawn a thread and give it some work. Here, I need
>to be notified if that thread does not finish the assigned task in
>certain time limit. Could anyone suggest me what would be the best
>way to do it, if any?

You'd probably need a second thread to act as a timer.  The problem is
that you need a way to notify the first thread to stop working, and that
can only happen if the first thread is processing work in small enough
chunks that it is easily interruptable.
-- 
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

I don't really mind a person having the last whine, but I do mind
someone else having the last self-righteous whine.  --Aahz



More information about the Python-list mailing list