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

Re: continuations and threads



>>>>> "Jim" == Jim Blandy <jimb@xxxxxxxxxxxx> writes:

Jim> Actually, this is less powerful than what I described.  In Roland's
Jim> system, you don't need to unwind the C stack when s1 invokes a.  You
Jim> only need to unwind the C stack when s0 returns.  If s0 instead
Jim> invokes some continuation b captured by s1, that's fine.
>> 
>> I'm not sure I'm getting what's going on here:  I *want* the C stack
>> to be unwound (it's a trivial-enough operation), so that the Scheme
>> heap references in the C activation records get freed---you might
>> get a space leak otherwise.

Jim> So, here's my original scenario:

Jim> The C function C1
Jim>   calls the Scheme function S1,
Jim>     which captures some continuation KS1
Jim>     and calls the C function C2,
Jim>       which calls the Scheme function S2,
Jim>       which captures some continuation KS2

Jim> So, in S2, the stack looks like: C1 S1 C2 S2
Jim>                                     ^     ^
Jim>                                     KS1   KS2

Jim> Invoking KS1 will return to somewhere within S1's code.  Invoking KS2
Jim> will return to somewhere within S2's code.  In particular, KS1 is
Jim> *not* S1's continuation --- it does *not* directly return to C1.
Jim> Similarly for KS2.

I understand what you're saying, but you haven't addressed my concern
(re-quoted above) at all.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla