[pygtk] More Help: Problems with the solution to: threads and pygtk

Stephen Langer stephen.langer at nist.gov
Fri Oct 6 21:29:01 WST 2006


On Oct 5, 2006, at 5:30 PM, David Hirschfield wrote:

> Here's the issue now: I don't know much about how the garbage  
> collector works in python, and in order to get the thread to run  
> without freezing, I'm wrapping the threaded processing function  
> with calls to gc.disable()/gc.enable().

Will that work?  Does calling gc.disable() on a thread disable  
garbage collection for all threads, or only for the calling thread?   
I suspect that what you want to do is to call gc.disable() once, and  
then call gc.collect() explicitly on the main thread (or whichever  
thread is handling gtk).

  -- Steve

--
-- EMail: stephen.langer at nist.gov                    Phone: (301)  
975-5423 --
-- WWW:  http://math.nist.gov/mcsd/Staff/SLanger/    Fax:   (301)  
975-3553 --
-- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md   
20899-8910 --

-- "I don't think this will work.  That's why it's  
science."               --
--                              Naomi Langer (age 6),  17 Feb  
2003         --




More information about the pygtk mailing list