Continuations and threads (was Re: Iterators & generators)

Robin Becker robin at jessikat.demon.co.uk
Fri Feb 18 04:17:56 EST 2000


In article <001301bf79dd$1c718c00$e62d153f at tim>, Tim Peters
<tim_one at email.msn.com> writes
....
>What's *interesting* is what the language could provide if they were
>available to a few insane souls to build on "under the covers".  A Scheme
>True Believer builds all control flow (from function calls thru exceptions
>to pseudo-threading) on top of them.  Python won't do that, and I expect
>Guido is just irked at suggestions that "he should" (why the hell should he
><wink>?).
>
>In Python the value would be for what they could provide we don't already
>have:  not exception-handling, but (most clearly) lightweight generators &
>coroutines, and (less clearly) lightweight alternatives to threads.  The
>pragmatics of Stackless are such that you can have thousands of
>"pseudothreads" running even on feeble platforms with no thread support; and
>without the C stack interwined in the program state, it's even possible we
>could whip something up to, e.g., freeze a (pure) Python program in
>mid-stream, pickle it, send it across the web, and resume it where it left
>off on some other architecture.
....

hear hear; the generator / iterator paradigm is the killer app for
stackless.

>Indulge some crazy-ass fanatasies!  Worrying about the mechanics of
>continuations here is akin to a debate starting about what kind of numeric
>types P3K should offer, that degenerates into an endless discussion about
>how best to build adder circuits in .18 micron technology <0.9 wink>.
>
>they're-a-means-not-an-end-ly y'rs  - tim
>
>
>

-- 
Robin Becker



More information about the Python-list mailing list