guile-user
[Top][All Lists]
Advanced

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

out-of-order GC


From: Egil Moeller
Subject: out-of-order GC
Date: Sun, 29 Dec 2002 17:36:28 +0100 (CET)

Hi!
I have a problem developing an extension library to guile in C: I have two
types of SMOBs, of which the first one represents a connection, and the
second one a transaction on such a connection. A transaction is created
by sending some data over the connection, and a handle will be returned,
which is then sent back over the connection to close the transaction.
Thus, the transaction-SMOB must contain a reference to the connection-SMOB
that was used to create it. The problem araises if no external reference
exist neither to a connection, nor to a transaction on that connection,
and both of them lost their external referrences before a GC. In this
case, it might happend that the connection-SMOB i first freed, and then
the transaction-SMOB. But the transaction-SMOB-free-routine will now
crash, as it tries to access the connection, which has allready been
deleted. How should I solve this problem? It is sufficient if the
transaction-SMOB-free-routine is notified about that the connection was
previously closed, and thus it is able to not take any action to send the
close-transaction-command (it would be nicer, thought, if one could force
the transaction-SMOB-free-routine to be called _before_ the
connection-SMOB-free-routine).
Regards,
Egil

-- 
http://redhog.org
GPG Public key: http://redhog.org/PGP%20Public%20key.asc
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!




reply via email to

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