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

Aaron Watters arw at ifu.net
Mon May 17 21:20:13 CEST 1999


The ineffible Gordon McMillan retorts:

> As a fuddy-duddy old imperative programmer, I'm inclined to think
> "state machine". But I'd guess that functional-ophiles probably see
> that as inelegant. (Safe guess - they see _anything_ that isn't
> functional as inelegant!).

As a fellow fuddy-duddy I'd agree except that if you write properlylayered
software you have to unrole and rerole all those layers for every
transition of the multi-level state machine, and even though with proper
discipline it can be implemented without becoming hideous, it still adds
significant overhead compared to "stop right here and come back later"
which could be implemented using threads/coroutines(?)/continuations.
I think this is particularly true in Python with the relatively high
function
call overhead.  Or maybe I'm out in left field doing cartwheels...

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

   -- Aaron Watters

===
I did! I did!






More information about the Python-Dev mailing list