Re: investigation into replacing ref. counts with leases



On Wednesday, July 18, 2001, at 04:33  PM, Havoc Pennington wrote:

Keeping in mind my earlier statement about in-process
vs. out-of-process - the timer in an event loop is probably fine for
renewing out-of-process leases, but I can't imagine any timer that
would be remotely a good idea for in-process objects.

A timer in an event loop is not fine for out of process leases, is it? You don't want to do some long operation where the program doesn't respond to the user and then have all your components self-destruct, right?

The timer is irrelevant for in-process objects. Although the lease machinery is used in-process, there's really no chance of any lease expiring since the renewing of the leases and the aging of the leases would use the same timer.

Thinking of this as a garbage collection algorithm, its properties
are either:

 - uncollected garbage can grow without bound as you are doing the
   work of your program, if your GC happens only in an event loop or
   the like

There's no garbage in normal operation with the scheme I was implementing.
This is not like GC in that respect. The "garbage" only occurs when a process dies without cleaning up after itself. In normal operation, leases are destroyed, which is done immediately. Old leases expire, and that's the part that's done with a timer. But a local reference would never have an old lease unless there was a programming mistake.

So leases are wholly inappropriate for small, pervasive objects.  Of
course at the moment Bonobo objects are really too heavy for this use
anyhow; even GObject is nearly too heavy for that, and the current
Bonobo implementation is at least as heavy as GObject for obvious
reasons.

So you really want to stick to refcounting (or real GC) for
in-process objects...

I think I have not been clear enough about this aspect of the thing. The interface for these leases is newLease, extendLease, and destroyLease. When the last owner lets go of an object, it's destroyed immediately as the result of a destroyLease that destroys the last lease, whether cross-process or in-process.

    -- Darin




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