About object reference and threads

Grumfish nobody at nowhere.com
Mon Jan 27 14:21:38 EST 2003


Laura Creighton wrote:
> and a Thread (made like this)
> 
>        self.thread1 = threading.Thread(target=self.workerThread1)

The thread shares the same members as self when using target like
that? I wanted a subclass of Thread with its own run method. Doing it
like the example said would mean the self.queue would refer to the
parent's queue member. Doing it the way I wanted, self.queue would
refer to the thread's queue. Am I correct? Is one way better than the
other?

I tried what Peter said and it seems to work but I can't realy test it
without finishing another part of the program.

Thank you.




More information about the Python-list mailing list