[rucksack-devel] Re: Rucksack, ECLM

Arthur Lemmens alemmens at xs4all.nl
Thu May 18 09:44:30 UTC 2006


Nikodemus wrote:

> I was about to say something about Lisp and Rucksack identities of objects,
> but I just realized what the _real_ trouble with this is: slot values.

I'm not sure that I understand what you mean here.

> If X was initialized as (make-instance 'my-p-thing :slot
> (make-instance 'my-p-thing-2)), then by the time we tried to add the
> root neither Lisp nor Rucksack would have the P-THING-2 around...

Well... Lisp would still have the P-THING-2 around, if I understand
your example correctly.

>> Probably the best approach would be to have the GC automatically mark
>> the in-memory copy of X as dead.  Then we could signal an error (how
>> about NECROPHILIA-NOT-ALLOWED-HERE?) for code that tries to do something
>> with a dead object.
>
> I assume you mean "committing the transaction", not GC?

No, I meant GC.  The transaction has no way of knowing if X is dead or not.
The only way to know that for sure is by doing the complete trace phase of
the garbage collector (just checking the roots is not enough).  That's
obviously not something you want to do for each transaction commit.

> If legality of the add-root bit depends on the amount of garbage
> collected in between.

Yeah, that's unfortunate but there's nothing we can do about that.  That's
why I really think it's a "don't do that then" scenario.  We can try to
do some cheap checks to prevent this kind of stuff from happening, but
we can't give any guarantee that you're protected from this.  It's just
too expensive.  Unless I'm missing something, of course.

> I wonder if there should be a way to keep transient roots, though (eg.
> P-LET, which informs Rucksack about the variables it binds).

Interesting idea.  You mean we'd have to keep some kind of P-LET binding
stack for a rucksack?  And all objects on that stack would be part of
the root set?

Sounds like a neat hack, but I'd like to see some kind of example where
this is actually useful before implementing this.

Arthur






More information about the rucksack-devel mailing list