[Python-ideas] Cofunctions PEP - Revision 4

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Aug 13 04:09:47 CEST 2010

On 12/08/10 18:44, ghazel at gmail.com wrote:

> why not just use threads?

One reason not to use threads is that they're fairly heavyweight.
They use OS resources, and each one needs its own C stack that
has to be big enough for everything it might want to do. Switching
between threads can be slow, too.

In an application that requires thousands of small, cooperating
processes, threads are not a good solution. And applications
like that do exist -- discrete-event simulation is one example.


More information about the Python-ideas mailing list