From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matt Hellige Newsgroups: gmane.lisp.guile.user Subject: Re: out-of-order GC Date: Mon, 30 Dec 2002 21:06:05 -0600 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <20021230210605.D16167@metro.immute.net> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041305135 22592 80.91.224.249 (31 Dec 2002 03:25:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 31 Dec 2002 03:25:35 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18TD25-0005sG-00 for ; Tue, 31 Dec 2002 04:25:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18TD0W-0006Om-06 for guile-user@m.gmane.org; Mon, 30 Dec 2002 22:23:56 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18TCzz-0006KW-00 for guile-user@gnu.org; Mon, 30 Dec 2002 22:23:23 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18TCzx-0006KL-00 for guile-user@gnu.org; Mon, 30 Dec 2002 22:23:22 -0500 Original-Received: from immute.net ([65.164.210.194]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18TCyH-00053U-00 for guile-user@gnu.org; Mon, 30 Dec 2002 22:21:37 -0500 Original-Received: (from matt@localhost) by immute.net (8.9.3/8.9.3) id VAA16272 for guile-user@gnu.org; Mon, 30 Dec 2002 21:06:05 -0600 Original-To: guile-user@gnu.org Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from redhog@redhog.org on Mon, Dec 30, 2002 at 03:05:40PM +0100 X-Mailer-Holy-War: Get Mutt, it bites! X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1485 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1485 [Egil Moeller ] > > 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: http://www.gnu.org/software/guile/docs/guile-ref/Programming-Overview.html 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 -- Matt Hellige matt@immute.net http://matt.immute.net _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user