unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Hellige <matt@immute.net>
Subject: Re: out-of-order GC
Date: Mon, 30 Dec 2002 21:06:05 -0600	[thread overview]
Message-ID: <20021230210605.D16167@metro.immute.net> (raw)
In-Reply-To: <Pine.LNX.4.30.0212301503420.1884-100000@urd.norna.redhog.org>; from redhog@redhog.org on Mon, Dec 30, 2002 at 03:05:40PM +0100

[Egil Moeller <redhog@redhog.org>]
> > 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


  reply	other threads:[~2002-12-31  3:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-29 16:36 out-of-order GC Egil Moeller
2002-12-30 13:36 ` Greg Troxel
2002-12-30 14:05   ` Egil Moeller
2002-12-31  3:06     ` Matt Hellige [this message]
2002-12-31 20:13     ` Neil Jerram
2003-01-01 10:57       ` Egil Moeller
2003-01-01 17:58         ` Neil Jerram
2003-01-01 21:22         ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021230210605.D16167@metro.immute.net \
    --to=matt@immute.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).