dev-serveez
[Top][All Lists]
Advanced

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

Re: [dev-serveez] guile gc


From: stefan
Subject: Re: [dev-serveez] guile gc
Date: Fri, 21 Sep 2001 15:15:10 +0200 (CEST)

On Fri, 21 Sep 2001, Martin Grabmueller wrote:

> > I just added an additional gc marker function to the svz-socket
> > smobs in order to inform guile about a possible SCM reference in
> > sock->data. Is that correct ?
> 
> I didn't look at it, but all SCM references which are still to be used
> must be rotected from GC, either by providing a masrking function, or
> by statically adding them to the set of protected objects.  The former
> method is encouraged.

By calling (gc) after setting up a data reference via (svz:sock:data) I
could make Guile telling me "GC missed reference" when accessing the data
item after (gc). That is why I think the gc marker function is correct,
too. (Did not occur again with the marker function).

> > If this is, then I wonder if we should mark all the callbacks referred by
> > servertypes, servers and sockets, too. Does guile also delete these
> > functions if not referred anymore ?
> 
> If there are no other references, they need to be protected, yes.
> 
> > Can this (unreferenced procedure) happen at all ?
> 
> No problem:
> 
> (define id (lambda (x) x))
> (set! id #f)
> 
> ... and the function created by the lambda above may be safely
> reclaimed by the GC.

Hm. How could we produce an error in a guile server ? Setting up a guile
procedure (echo-handle-request) with a lambda expression. But how can the
reference be lost without reassigning it (that would just reassign the
saved procedure, too ???) ?

Thanks in advance,
        address@hidden




reply via email to

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