[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: out-of-order GC

From: Matt Hellige
Subject: Re: out-of-order GC
Date: Mon, 30 Dec 2002 21:06:05 -0600
User-agent: Mutt/1.2.5i

[Egil Moeller <address@hidden>]
> > It sounds like your problem is that the transaction SMOB is holding a
> > reference to the connection SMOB, but that the GC system is not aware
> > of this.  The transaction SMOB's mark routine should return (or call
> > mark on) the connection SMOB.  Thus, until all the transaction SMOBs
> > are freed, the connection SMOB will still be in use.
> I thought so first, but it turned out, I did have a mark-routine for the
> transaction-SMOB that did return the connection-SMOB. The problem
> thus never araised when there was a referense to the transaction-SMOB,
> only when there where no reference to neither one any more...

Yes, I suspected at first that marking was the problem, but I think
it's not. As you say, the problem as you described would still
possibly occur when both smobs are ready to be collected. I think you
could use a trick similar to the one described in the dia example:

That way, the transaction smob will always refer to a valid structure
wrapping a connection smob. The connection smob should point to the
same structure, and if freed, should indicate such in the wrapper.
Then the transaction smob will notice that its connection has been
freed and can take appropriate action, freeing the wrapper structure
in the process.

The extra layer of indirection shouldn't be too expensive, and it
should solve your problem.


Matt Hellige                  address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]