thread help

Peter Hansen peter at engcorp.com
Wed Jun 16 01:14:32 CEST 2004


Roger Binns wrote:

> In the simplest case you can just make all your threads be
> daemon.  Python will shutdown when there are no non-daemon
> threads left, so you can just exit your main loop and all
> will shutdown.  However that means the worker threads just
> get abruptly stopped in the middle of what they were
> doing.
> 
> (IMHO it would be *really* nice if Python provided a way
> to interrupt threads).

Sounds like you can't eat your cake and have it, too.  If
you _could_ interrupt threads**, wouldn't that mean "the worker
threads just get abruptly stopped in the middle of what they
were doing"?

-Peter

** There is a way to interrupt threads in Python now, but
it requires an extension routine, or perhaps something with
ctypes.  Findable in the archives for this newsgroup/list.



More information about the Python-list mailing list