Beazley on Generators

Paul Rubin http
Thu Apr 2 04:02:48 CEST 2009


Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> writes:
> > However, there are situations when you need thousands of lightweight
> > threads of execution ;;;
> 
> The Linux kernel has been tested running hundreds of thousands of threads.

Those are still heavyweight threads requiring context switches to
switch from one to another.  If you look at the multi-threading
benchmarks in the Alioth shootout, languages with lightweight threads
(such as Erlang or GHC) can switch orders of magnitude faster than
those that use kernel threads.



More information about the Python-list mailing list