develooper Front page | perl.bootstrap | Postings from July 2000

Re: perl 6 requirements

Thread Previous | Thread Next
Alan Burlison
July 31, 2000 05:28
Re: perl 6 requirements
Message ID:
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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About