[Python-Dev] coroutines vs. continuations vs. threads

Tim Peters tim_one at email.msn.com
Tue May 18 06:46:12 CEST 1999


[Aaron Watters]
> ...
> I guess the question of interest is why are threads insufficient?  I
> guess they have system limitations on the number of threads or other
> limitations that wouldn't be a problem with continuations?

Sam is mucking with thousands of simultaneous I/O-bound socket connections,
and makes a good case that threads simply don't fly here (each one consumes
a stack, kernel resources, etc).  It's unclear (to me) that thousands of
continuations would be *much* better, though, by the time Christian gets
done making thousands of copies of the Python stack chain.

> If there aren't a *lot* of situations where coroutines are vital, I'd
> be hesitant to do major surgery.  But I'm a fuddy-duddy.

Go to Sam's site (http://www.nightmare.com/), download Medusa, and read the
docs.  They're very well written and describe the problem space exquisitely.
I don't have any problems like that I need to solve, but it's interesting to
ponder!

alas-no-time-for-it-now-ly y'rs  - tim






More information about the Python-Dev mailing list