Generators versus Coroutines

Nick Patavalis npat at efault.net
Tue Aug 17 02:29:39 EDT 2004


On 2004-08-16, Lenard Lindstrom <len-1 at telus.net> wrote:
>
> As for doing it in Python, coroutines can be implemented using 
> threads.
>

But threads cost! And how much they cost depends on the operating
system. Coroutines cost close to nothing, and are O/S independent. The
only reason to use O/S threads is if you need preemption, and if you
want to cater for parallel execution.

> Lenard Lindstrom
><len-l at telus.net>



More information about the Python-list mailing list