Re: Re: my garbage collector sucks
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Paul Prescod wrote: > It is probably not a deciding factor, but if you put performance > aside, reference counted languages can make guarantees about object > finalization that m&s garbage collected languages cannot. It turns out that is a myth. As an outcome of the turing halt theorem, you cannot predict when and on which instruction the count will go to zero for different program inputs. The final result turns out to be identical for ref counting and tracing. > Clearly reference counts are losing the meme war and have been doing > so for quite a while, but perhaps when we all run terahertz computers > reference counts will come back as an implementation technique to > simplify finalization. In all the reading I did today the bottom line was that ref counting and tracing (mark/sweep) have equivalent advantages/disadvantages but in different situations. The reason Java and .NET are using tracing has to do with control. You cannot change the ref counting algorithm and behavior. With tracing you can fine tune the algorithm. Ref counting has a problem with cascading deletes. One ref count going to zero can cause an arbitrarily large number of objects to need to be deleted and cause an arbitraily long pause to the system.