Stopping threads

Jp Calderone exarkun at intarweb.us
Mon Feb 3 14:21:37 EST 2003


On Mon, Feb 03, 2003 at 04:07:07PM +0000, 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

  threading.Thread provides no capabilities for this.  Subclass it and add
the necessary logic to return the Thread to a runnable state when it has
finished a run; from a brief glance at the source, setting __started back to
0 might be enough to make this work.

  Jp

-- 
<Ape> EludeR: what kind of distro you have?
<EludeR> Ape: gentoo
<Ape> EludeR: it seems it have bsd-style init?
<EludeR> i dont know
<EludeR> have no clue
-- 
 up 49 days, 23:50, 4 users, load average: 0.82, 0.56, 0.23
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030203/746b300e/attachment.sig>


More information about the Python-list mailing list