lua-users home
lua-l archive

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


On Thu, 29 May 2003, Basile STARYNKEVITCH wrote:

> >>>>> "Thatcher" == Thatcher Ulrich <tu@tulrich.com> writes:
>
>     Thatcher> In case anyone is interested, I've written down my
>     Thatcher> current thoughts about garbage collection (not
>     Thatcher> necessarily specific to Lua), including a nice succinct
>     Thatcher> quote by Ken Thompson.  Executive summary: ref-counting
>     Thatcher> is good.  Here's the longer version:
>
>     Thatcher> http://tulrich.com/geekstuff/ref-counting-is-good.txt
>
> I didn't found your arguments convincing in the general case (even if
> I agree that they are some applications - perhaps some games? - where
> refcounting is acceptable, and that coding with refcounting is
> *apparently* easy in C). You might also want to study some good
> reference books on GC (like Jones&Lins')

Yes, I've studied that book carefully, and implemented some of the
algorithms in it.

> The major point against reference counting is circular
> references. They are quite common, and actually can appear during
> coding (in the sense that you might need them even if at the design
> stage you thought that your reference graph is a DAG). Of course,
> there are some dirty hacks to refcount circular graphs, but these
> remain only dirty hacks which are very difficult to maintain.

Well -- to some extent I see mark-and-sweep as one such dirty hack.
IMO the *ideal* GC would always collect objects, in a well-defined and
"intuitive" order, the moment they become unreachable.

> You can glance at the GC list archive on
>    http://lists.tunes.org/mailman/listinfo/gclist
> and you can subscribe to it by email to gclist-request at
> lists.iecc.com

Thanks for the reference, I will have a look at the list.

-Thatcher