Stopping threads

Afanasiy abelikov72 at hotmail.com
Mon Feb 3 11:07:07 EST 2003


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.




More information about the Python-list mailing list