Re: perl 6 requirements

[email protected] (Alan Burlison) Mon, 31 Jul 2000 13:28:05 +0100
Newsgroups perl.bootstrap
Message-ID <[email protected]>
Hildo Biersma wrote:

> In item 2.4 (garbage collection), we need to make sure there is an
> alternative for people that need guaranteed cleanup time of their
> objects (such as SelectSaver).  To a large extent, this could be solved
> by having a special kind of 'Guard' object in the language that either
> is reference-counted or cleaned up when the scope it lives in is exited;
> the 'Guard' object can then run a 'finalize'-like cleanup method for the
> object it is guarding.

The trouble with all automated garbage collection schemes is that they
tend to be non-deterministic.  Having your program grind to  a halt at
irregular intervals is not a good thing.  What about some sort of
hybrid, using reference counting as the first and default way of
reclaiming memory, with a full GC pass at selectable points, e.g. never,
every n seconds, whenever a block bigger than a given size is allocated,
at interpreter instance exit, on demand etc.  The existing refcount
mechamism has worked well, and has predictable behaviour.  It seems a
shame to throw it out in favour of something that in most cases probably
won't work as well.

-- 
Alan Burlison