Stopping threads

Afanasiy abelikov72 at hotmail.com
Mon Feb 3 14:06:40 EST 2003


On Mon, 03 Feb 2003 19:32:44 +0300, Anton Muhin <antonmuhin at sendmail.ru>
wrote:

>Afanasiy wrote:
>> I am running up to half a dozen threads as needed. When a thread is done
>> working, it is available for more work. However, I cannot call start() on
>> that thread again... AssertionError: thread already started
>> 
>> In another language I could stop() (as well as pause/resume/waitfor/etc)
>> and do what I want. However, in Python Threading I do not know what I
>> should do. I want to be able to call the thread's start() multiple times,
>> but of course only do so when it has finished run()'ing... (which I track)
>> 
>> The most obvious thing I looked for was stop(), but there is none.
>> 
>> So what should I do? Good answers will not require me to adopt
>> some other thread pool paradigm, as my own is the usual for me.
>
>Feed your threads with Queue'd data.
>
>Anton.

Ah excellent, of course. Thanks.





More information about the Python-list mailing list