Threading & garbage collection

Matt Gushee mgushee at havenrock.com
Wed Jan 12 08:50:25 EST 2000


Hi, folks--

Another dumb threading question here:

I'm trying to write a subclass of threading.Thread where each
thread:

  1) is invoked by a GUI event handler
  2) collects some data (to be exact, it downloads a web page
	and extracts some information from it), and finally
  3) invokes a GUI method to display the data

The run() method of my subclass would look something like this
(unless someone has a better idea):

    def run(self):
	## various thready actions
	.....
        self.win.thread_done(data)

... where self.win is, of course, a GUI object. Do the standard
rules about circular references apply to threads? I.e., should I
add something like:

	self.win = None

to the above?

Thanks in advance for your tips!

-- 
Matt Gushee
Portland, Maine, USA
mgushee at havenrock.com
http://www.havenrock.com/



More information about the Python-list mailing list