From: Justin Johnson Date: 2002-07-04T03:33:58+09:00 Subject: Re: Ruby implementation Q's > I've had to deal with this particular problem while designing Parrot. > The only way to do this is with reference counting, but unfortunately > reference counting has a number of unfortunate downsides. (Including, > but not limited to, speed penalties, lots of code complexity, a > tendency to be error-prone during development, and leakage of > circular structures) On the upside, reference counting does get you > deterministic destruction, but I don't usually consider that > worthwhile enough to offset the downsides. It's not guaranteed deterministic destruction because of the cyclic reference issue. Cyclic reference garbage is solved using a mark-and-sweep, is that how you've solved it in Parrot? If so, reference counting means that you'll probably get destruction when the object becomes unreachable from the root set, but that may not always be the case. > It's possible to offset the lack of deterministic destruction if you > require a sweep for dead objects at some regular time. (End of block > time is a good one, as there's generally other cleanup that needs > doing then) It's not a perfect offset, but doing that is awfully > expensive. It basically boils down to: "Can the object be reached from the root set?" Your right, thats too much to be doing too often. I like the sound of your closing paragraph and will adopt it's wisdom upon failing to find a good solution. :-) -- Justin Johnson justinj@mobiusent.com Technical Director Mobius