[pygtk] Help: Problems with threads and pygtk
David Hirschfield
davidh at ilm.com
Fri Oct 6 02:45:18 WST 2006
Holy garbage collection, Batman!
That was totally it. Or at least mostly it.
If I surround the actualy processing code in the thread with a
gc.disable()/gc.enable() pair, the freeze never occurs!
Oy! So, basically that means that even though my thread code wasn't
actually touching gtk objects, the garbage collection was dumping gtk
stuff from memory and that was killing things? That's really troublesome
to me for some reason. But things are working much better now.
Thanks for the tip, have you encountered similar problems before?
-Dave
John Ehresman wrote:
> David Hirschfield wrote:
>> Yeah, I have that around my call to gtk.main(), although as far as I
>> know you shouldn't need it unless your thread code touches gtk
>> widgets or calls gtk functions.
>>
>> The code in my thread does none of that, it only accesses database
>> connections, sockets and some special xml-rpc stuff. There is no
>> crossover between the thread and the UI except via the synchronized
>> queue which handles requests, that's all.
>
> Could it be occurring during gc? You might use the debug flags in the
> gc module to help figure this out. Could a gtk object be unref'd in a
> thread other than the main thread, where you other gtk operations are?
>
> Cheers,
>
> John
>
--
Presenting:
mediocre nebula.
More information about the pygtk
mailing list