On Sun, 11 Jan 2004, Leopold Toetsch wrote:

> Michal Wallace <[EMAIL PROTECTED]> wrote:

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

Yes, that's what I meant. It's called each time you invoke
the coroutine. I don't understand why it doesn't have to be
swapped back each time you suspend the coroutine.

But then again, I tried fixing it myself and it didn't work...
Maybe I'll understand once I see how you fix it.


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

Awesome! Thanks!


Sincerely,

Michal J Wallace
Sabren Enterprises, Inc.
-------------------------------------
contact: [EMAIL PROTECTED]
hosting: http://www.cornerhost.com/
my site: http://www.withoutane.com/
--------------------------------------

Reply via email to