By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,271 Members | 1,722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,271 IT Pros & Developers. It's quick & easy.

Question about turning off garbage collection

P: n/a
Question from a post to pygtk list...but it probably would be better
answered here:

I encountered a nasty problem with an external module conflicting with
my python threads recently, and right now the only fix appears to be to
turn off garbage collection while the critical code of the thread is
running, and then turn it back on afterwards.

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().

So what's that going to do? Will calling gc.enable() put things in good
shape? Will all objects created while the garbage collector was off now
be un-collectable? I'm extremely wary of this solution, as I think
anyone would be. I don't want a suddenly super-leaky app.

Comments? Suggestions? (I know, I know, avoid threads...if only I could)
-Dave

--
Presenting:
mediocre nebula.

Oct 6 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.