Generators versus Coroutines

Nick Patavalis npat at
Tue Aug 17 08:29:39 CEST 2004

On 2004-08-16, Lenard Lindstrom <len-1 at> 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>

More information about the Python-list mailing list