Question about turning off garbage collection

  • Thread starter David Hirschfield
  • Start date
D

David Hirschfield

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top