Continuations and threads (was Re: Iterators & generators)
moshez at math.huji.ac.il
Thu Feb 17 13:51:21 EST 2000
On 17 Feb 2000, Aahz Maruch wrote:
> Okay, now I'm starting to get this (be very, very frightened). Now, can
> you (or someone) provide an equally simple explanation of the
> differences between continuations and threads? Given that we already
> have threads (sort of), what is the attraction of continuations? Is it
> easier to write continuations than simulate threads on an unthreaded OS?
Oh, continuations *cannot* be simulated by threads. (Coroutines can be
simulated by both, however). They are much more powerful then you think:
you can implement all sorts of funky control behaviour, from classic
exception handling to the types of exception where the catcher can
"correct" the situation and "retry". Very, very, cool.
be-much-more-frightened-ly y'rs, Z.
Moshe Zadka <mzadka at geocities.com>.
INTERNET: Learn what you know.
Share what you don't.
More information about the Python-list