Stopping a python thread
Oleg Broytmann
phd at phd.russ.ru
Thu Oct 19 03:58:34 EDT 2000
Hi!
I am not the author of the original question, but still...
On 18 Oct 2000, Aahz Maruch wrote:
> In article <8sksk4$b6c$1 at nnrp1.deja.com>, <cullman at my-deja.com> wrote:
> >
> >Is there any support for stopping a thread that was spawned from the
> >main thread?
>
> What do you need to do this for? The standard response is that the
> spawned thread should determine when it should stop processing work and
> execute a "return". That will kill the thread automatically. There are
But what if a thread just waited for some event and cannot return? For
example, a thread that uses urllib to retrieve a file and urllib just
hangs; you know, urllib is pretty bad regarding timeouts :(
> a variety of ways of signalling the thread to exit.
Which ways? (I'm really interested 'cause I'm writing and debugging a
framework for mananging a big collections of URLs; currently the best
solution I've found is forking - just kill a process on timeout; next thing
to try will be threading and asyncore-based robots)
Oleg. (All opinions are mine and not of my employer)
----
Oleg Broytmann Foundation for Effective Policies phd at phd.russ.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-list
mailing list