Re: A non-sucking garbage collector

Paul Prescod <[email protected]> Tue, 27 Jul 2004 18:35:14 +0200
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Found this in my outbox. I guess it was never sent. ;(

Mark Hahn wrote:
> I have figured out how to have my cake and eat it too. I have a design for
> the world's only garbage collector that has all the desired features with no
> trade-offs:
> 
> 1) Mark and sweep (tracing) for tunable maximum performance including
> multiple cpus.
> 
> 2) Continuous operation.  Interpreter never stops (except for thread
> switching).
> 
> 3) Deterministic finalization can be added based on scope.

Am I correct in thinking that this last feature is actually unrelated to
the others?

> ---- Deterministic finalization ---- 
> 
> The deterministic finalization can be added by a seperate mechanism Paul
> suggested.  A seperate frame-based object collector mechanism is used in
> tandem with the one above that works in a Prothon frame scope only. It
> reclaims objects immediately that were created in a frame and never left the
> frame before the frame was destroyed.  This is analogous to local vars on a
> stack in C.  I will change the wiki item that is in the 1.0 list for the
> future to specifically describe this feature.

I'm not sure if I actually suggested this or forwarded a suggestion
about it.

How do you tell if an object reference "ever left the frame?" Wouldn't
they almost always leave the frame? If you call obj.foo(), the method
"foo" sees a reference to its self pointer and could store it away anywhere.

Maybe you should consider the Python PEP "Reliable Release/Aquisition
Pairs".

  Paul Prescod