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: Wed, 5 Dec 2001 01:52:46 -0500

> From: Michele Bini <address@hidden>
> 
> I think that there is a problem with storing continuations for
> coroutines in lexically scoped (non-global) variables or passing
> them as arguments or as return values,

Well, there is not _always_ a problem, since the Knuth co-routine
example I posted, and which does work, uses nothing but non-global
variables.  The whole program is a single function definition with
local variables.  It is impossible to use call/cc without passing
a continuation as argument---that's what it does.  Maybe return
values that should be popped are finding their way into permanent
storage.

> since when you create a continuation to save the current execution
> point for a coroutine there is the risk that a reference to the
> continuation for a previous execution point still exists

More than a risk.  It seems that whatever goes wrong, goes wrong
every time.  This is not accidental match of bit pattern throwing
the conservative GC off.  (I guess)

-- 
     -- 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]