Stackless 3.0 alpha 1 at blinding speed

David Abrahams dave at boost-consulting.com
Mon Apr 21 07:55:56 EDT 2003


Courageous <jkraska at san.rr.com> writes:

>>Thanks. It seems Tim is making a heroic effort to explain the new in
>>terms of the old. This necessarily must fail, but what other option is
>>there instead of rebuilding all terminology out of gotos?
>
> "non local goto" describes it well, but another way of looking at
> it is as a "first class, user controlled context switch". That's
> actually the meat of what it is. In unix, theoretically one could
> set up the heavy weight equivalent of a continuation by the use of
> setjmp and

Really?  I thought longjmp could only go back up the call stack,
losing any execution context from inner frames.  The whole point of
continuations, AFAICT, is that:

       1. execution context is preserved
       2. You can transfer control up, down, or between call stacks.

> In conjunction with a "stackless" environment, a continuation is
> actually a very lightweight state save coupled with the ability
> to restore to the last point the continuation was set.

That sounds right, but I don't see how it relates to setjmp/longjmp.

Also, "stacklessness" is really an implementation detail AFAICT - it
just says that all execution context is stored in
dynamically-allocated structures instead of using local variables on
the 'C' stack (via a recursive-calling implementation).

Have I misunderstood this whole thing?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Python-list mailing list