lua-users home
lua-l archive

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


On Sun, May 31, 2009 at 19:36, Mark Hamburg <mark@grubmah.com> wrote:
> You can't just reference count some of the items, however, and have rapid
> (a.k.a. deterministic) destruction. If a traced rather than reference
> counted object refers to a reference counted object, then the reference
> counted object won't go away until the traced object does.

You mean a zombie traced object (waiting for the garbage man)? Because
I don't see why, since the ref. count would decrement with each
unbinding of the ref.counted object, _at the moment of unbinding_, not
later. A live reference, sure, it has a +1 to keep the ref. counted
object alive, but that's well in the semantics.

> I think the current policy that says essentially, "if you know the lifetime
> of the resource usage, then close it explicitly and have the resource throw
> errors if you use it after closure; if you don't know the lifetime, then
> live with GC" is a reasonable compromise. It is interesting to look at ways
> to make the explicit close path easier to write and implement, but that's
> not essential.
>

Hm, I don't think it's in the gc semantics to be non-deterministic
--that's just an implementation detail that doesn't change the way I
reason about variable unbinding -- as far as I know, they go when they
look like going -- when going out of scope or by re-assignment.