lua-users home
lua-l archive

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


Mike Pall wrote:
[...]
> Reference counting (RC) has plenty of practical problems. One key
> aspect is that the impact is hard to measure, since the overhead
> is spread out all over the code. Some issues, like excessive
> number of writes, cache pollution, unbounded latency vs. delayed
> free, etc. can be solved with more complex variants of RC.

In an earlier life I worked on an object-oriented operating system where
all objects were reference counted.

Never, never again.

Not *only* does it have the problems described above, it's also
incredibly brittle and easy to break. Forgetting to take a reference or
drop a reference can lead to obscure and hard-to-find bugs. And it makes
the code verbose and difficult to read. *And* since dropping a reference
can conceivably lead to the object being destroyed then and there, if it
was the last reference, it means you have to be really careful when
references get dropped.

Annoyingly, we actually had a full stack-crawling garbage collector as
it was needed to make Java work, and it would have been pretty easy to
adapt it to manage the entire OS and not just the VM, but management
would do it because 'it was too much work'. Sigh.

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "I have always wished for my computer to be as easy to use as my
│ telephone; my wish has come true because I can no longer figure out
│ how to use my telephone." --- Bjarne Stroustrup

Attachment: signature.asc
Description: OpenPGP digital signature