guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about coroutines


From: Keith Wright
Subject: Re: about coroutines
Date: Fri, 7 Dec 2001 04:26:55 -0500

> From: Marius Vollmer <address@hidden>
> 
> Ok, here is what I've found.
> 
> It's a real conservative GC bug, and it's impossible to fix (without
> going to a precise GC or non-copying continuations) since it is all
> over the place.  The continuations stick in a stack slot that is not
> associated with any variable, it's just debris from a previous
> function call (specifically, from building the lexical environment of
> call-with-current-continuation).

I'm not quite understanding.  Are things that have been popped off
the stack getting included in the copied continuation stack, or
is the stack getting pushed without being initialized?  (Or
are those both wrong?)

> What I think would be a good solution would be to offer one-shot
> continuations that can only be invoked once.  That way, we could
> deallocate the continuation stack once it has been copied back, and
> stale references in it would not confuse the GC.  An adhoc
> implementation is just running the original coroutines-test in
> constant space.
> 
> We could even avoid copying the stack in the first place, when the
> continuation is invoked before its creating call/cc returns.
> 
> One-shot continuations should make for a nice SRFI, actually.

Ouch.  I don't think so.

-- 
     -- Keith Wright  <address@hidden>

Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
         ---  Food, Shelter, Source code.  ---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]