[rucksack-devel] Re: Rucksack, ECLM

Nikodemus Siivola nikodemus at random-state.net
Thu May 18 07:30:32 UTC 2006


"Arthur Lemmens" <alemmens at xs4all.nl> writes:

>> * GC of live-in-lisp but dead-on-disk objects. I should just read the
>>   code, I suppose, but what is the intended result here:

> ** reserved-object (#xB3)
>
> Used for entries in the object table that belong to objects that
> haven't been committed to disk yet.
>
> The X in your example is a RESERVED-OBJECT as long as the transaction
> hasn't committed yet, so it won't be collected by the GC.  When the
> transaction commits, the marker will change to LIVE-OBJECT.  (At
> least that's the plan; I think I haven't written the part that changes
> the marker to LIVE-OBJECT at the moment.)
>
> Only at the start phase of the *following* garbage collection round
> will X be treated like a normal object: seen as alive if it can be
> traced from the roots and as dead otherwise.

Good. This answers one of the things I forgot to ask about. ;-)

Unfortunately I think I messed up my example, as it was about
a different case. Like so:

(with-rucksack (s ...)
 (let (x)

   (with-transction ()
     (setf x (make-instance 'my-persistent-thing)))

   ;; Transaction is now over, and committed -- so if X live it is
   ;; being retained without a connection to the roots.

   (do-stuff-to-cause-a-gc-of-dead-x)

   (with-transaction ()
     (add-rucksack-root x s))))

> (It wouldn't surprise me if there were other problems similar to this
> one that I haven't thought about yet.  This correspondence between
> in-memory and on-disk stuff is rather tricky, and it's easy to forget
> some subtle point.)

I got an immediate headache thinking about it. ,-)

It seems to me that for persistent objects (once they are actually
stored on disk!) the "real" definition of identity is the object
on disk, and the objects in memory are just "echoes".

...unless of course there are both persistent and non-persistent slots,
in which case you really have two instances sharing the same shadowy
body: for the persistent slots the definition of identity that matters
is mediated by the Rucksack, but for non-persistent slots it is the
plain old EQ -- which is a matter of luck depending on that cache.

Interesting.

Cheers,

  -- Nikodemus              Schemer: "Buddha is small, clean, and serious."
                   Lispnik: "Buddha is big, has hairy armpits, and laughs."



More information about the rucksack-devel mailing list