On Sun, Aug 8, 2010 at 12:51 AM, Guido van Rossum <guido@python.org> wrote:
On Sat, Aug 7, 2010 at 3:05 AM, Carl M. Johnson <cmjohnson.mailinglist@gmail.com> wrote:
Of course, as we all know on the OS side of things, cooperative multitasking has been more or less phased out [...]
I don't think you can see this as reflecting badly on cooperative multitasking. Rather, it is now understood better and has moved entirely to user space, leaving the OS to deal with preemptive threads, which cannot work well without OS support. As an example of cooperative multitasking being alive and well, see Stackless, Greenlets, and, in fact, coroutines built out of generators (possible in Python 2.5 and later).
Even simpler: GUI event loops are fundamentally about cooperative multi-tasking. To me, the cofunction idea is really about making it easier to write event loop code. I think PEP 380 works well on its own, but will work better when paired with a separate cofunctions PEP (similar to how PEP 342 and PEP 343 were best considered as a pair of co-proposals that went together, even though they were technically independent of each other). Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia