[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [dev-serveez] GC issue
From: |
Martin Grabmueller |
Subject: |
Re: [dev-serveez] GC issue |
Date: |
Sun, 21 Oct 2001 13:43:17 +0200 |
> From: stefan <address@hidden>
> Date: Thu, 18 Oct 2001 16:36:19 +0200 (CEST)
>
> Some of the SMOBs used for the Guile servers in Serveez are of temporary
> nature. Server instances <svz-server>, sockets <svz-socket> an binary
> SMOBS <svz-binary> are protected from GC where needed by an appropiate
> marker function now.
I don't quite understand what you mean with `temporary' in this
context. Could you please clarify?
> But two things are still left: When assigning callbacks within
> (define-servertype!) to a <svz-servertype> these are protected from GC
> when using <svz-socket> and <svz-server> by getting the parent of them.
> This concept does not work if there are more than a single Guile server
> and you run (gc) in one of them since there is no SMOB containing a
> reference to the others at this time.
> It is the same with the (svz:sock:data) thingy. It might happen that
> there is currently no <svz-socket> at (gc) time when having more than a
> single connection.
Again, I don't get why more than one of servers or sockets breaks gc.
> This is all because all of these SMOBs are just temopary. My question
> now: How can we portably (>= Guile 1.3.x) protect some Guile data from GC
> ? I know there different concepts (like permanent objects and root sets),
> but I am not sure which to take and what are the advantages /
> disadvantages of each.
The portable solution is to protect the objects with
scm_protect_object and to unprotect them with scm_unprotect_object
when they are no longer needed.
HTH,
'martin