Michal Wallace <[EMAIL PROTECTED]> wrote:

> Hey all,

> When you invoke a Coroutine, it calls swap_context()
> from src/sub.c ... There's an else clause in there
> that either swaps or restores theinterpreter  stack,
> but as far as I can tell, swap_context() is ONLY
> called when entering a coroutine - not when we're
> suspending it.

No, swap_context() is called for each invoke of the Coroutine, that is
ok. But (as with Continuations) the register frame stacks are *not*
swapped. So the "zero" in your example (in P16) is shared between the
Coroutine and main.

If no one hollers, I'll apply Luke's patch WRT register stacks and
Continuations and then fix Coroutines.

leo

Reply via email to