In article <[EMAIL PROTECTED]>, Benjamin Niemann <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] wrote:
>> However, in my current project I'm creating a bunch of threads which
>> are supposed to run until they've completed their run() method, and I'm
>> worried that if I do not keep references to these thread objects
>> around, the GC might happily delete them (and thereby kill my thread
>> routines maybe?) while they're not done yet. Is this fear justified?
>The threading module does already take care of keeping references to all
>running threads,
The implementation of threading.enumerate() would be entertaining if it
didn't.
Quite apart from which, I presume the OP's run() method looks something
like:
class MyThread(threading.Thread):
def run(self):
...
So what is self if not a reference to the Thread object which is kept
around until run() has completed?
--
\S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/
___ | "Frankly I have no feelings towards penguins one way or the other"
\X/ | -- Arthur C. Clarke
her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
--
http://mail.python.org/mailman/listinfo/python-list