lua-users home
lua-l archive

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

> [...]
>> I'm not sure how can this interfere with GC. If table is not
>> referenced anywhere, it would be collected regardless of its contents.

> Garbage collecting a distributed system is one of the classic Hard
> Problems. (I don't know if there's a proper solution yet.) Most people
> don't even try, and instead manage lifetimes manually. This requires you
> to design your data structures to allow this, of course. The classic Lua
> big-bag-of-data approach won't work --- we can't destroy object #1234 on
> machine X until object #91872 on machine Y and object #173791 on machine
> Z have stopped using it, and we may not be aware of any potential users.

> An approach that I've seen used successfully is to divide objects up
> into heavyweight and lightweight. Each heavyweight object has a global
> ID. Lightweight objects are owned by exactly one heavyweight object and
> are stored next to their owner. No heavyweight object can refer to a
> lightweight object belonging to a different heavyweight object.

If we limit ourselves to a single data tree, wouldn't that let us to
mark its subnodes for collection by assigning nil to them in either of
the clients (provided that the tree is properly synchronized)?


> Synchronisation is also fun. The simplest approach is to do all remote
> accesses synchronously so that ever access involves a roundtrip --- but
> that's expensive. Caching stuff locally is much faster but then you
> start needing transaction blocks to manage concurrency, which can easily
> become a nightmare.

Yes, that's a large task by itself.

I've always thought that, in a peak, one would need something close to
Source engine networking system: