Re: my garbage collector sucks

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Paul Prescod wrote:

> I'm not pushing for reference counts: I'm just tired of illogical
> arguments (not just here) against deterministic finalization.
>
> By the way, you can get a subset of the benefits of deterministic
> finalization if you implement a feature that scopes objects to their
> containing functions as stack variables in C/C++ are scoped to their
> containing functions.
>
> http://c2.com/cgi/wiki?DeterministicFinalization
>
> As long as you are careful to never pass these objects out of your
> function you are okay...

By the way, after all my arguments against using finalizers, you'll note
that in a typical Mark Hahn fashion I included deterministic finalizers in
the list of items to consider for inclusion in Prothon 1.0.  In other words
if you can rally enough support and talk me into it I will put some kind of
support for it into the language.

Nothing is impossible and it would be a real challenge to add it so my
objects.  I am thinking I would add a bit to objects to make just a few
objects special that need to be deterministic.  They would be tracked with a
special ref-counter just for the determinism.  This would not require
special C coding for every pointer access like ref-counting GC, but instead
the locking code would do extra work when it see's this bit.  So it would be
very expensive but only for these objects.

Having said that, right now I would still vote against it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.