On Wed, Jul 24, 2002 at 10:38:09PM +0200, Peter Gibbs wrote:
> "Mike Lambert" wrote:

> > I know that there are faster solutions to the problem of child collection,
> > but Dan doesn't want to use them due to the problems that occur when we
> > start using exceptions (and longjmp, etc).
> 
> If performance has to halve in order to implement such features, I hope
> somebody plans to write Parrot::Lite!

I'm not sure if I understand the problem properly, but is the problem with
using exceptions (or using longjmp) and the like to unwind that we can't
trust external extensions to play ball with our rules when we need to unwind
through them? And that if we didn't have to call out to external code, we
could use the faster methods without needing stack walking?

If so, is it possible to make a hybrid scheme, whereby if we know that
between the two marks on the stack we've not called out to any external
code we use the faster mechanism to check for leaks, but if we know that
we entered external code (and must have come back in because we're now back
in the parrot garbage collection system called by another parrot call) use
a tack walk. Obviously we'd carry the overhead of more bookkeeping, but it
might win if it saves the stackwalk. (and thrashing the cache in the process)

I can envisage that we could "know" by having a count of departures to
external code, storing this at or as the stack mark needed for marking
one end of walking, and checking in the garbage collector to see if the
external count is the same. This would mean that every call out to an
external routine would have to be "wrapped" in some way to increase this
counter, and decrease it on return. Which is more housekeeping. As well as
also having all the housekeeping needed by whatever the other faster method
for GC of partially created objects was.

So this idea may all be garbage anyway.

Nicholas Clark

PS If you're wondering what I'm smoking, currently it's dust.
   [on my hi-fi. I'm having a brief burst of loud, and this makes the amp hot]
-- 
Even better than the real thing:        http://nms-cgi.sourceforge.net/

Reply via email to