Opposite of yield?

Chris Liechti cliechti at gmx.net
Wed Sep 10 23:53:17 CEST 2003


achrist at easystreet.com wrote in news:3F5F95B9.A8CB5786 at easystreet.com:

> Peter Hansen wrote:
>> 
>> 
>> Queue.Queue.get() ...
>> 
> 
> That looks good.  But that needs a thread to block, right? 

yes

> A generator manages to run without being a thread (at least
> overtly).  If we have the suck() statement, we also need 
> something that's the opposite of a generator (a Sucker?)
> and something that's the opposite of an iterator (a Suckee?). 
> I'm starting to get an idea why this is completely not all
> there. 

basicaly you poll every generator (or more precicly "iterable" as that is 
what a generator returns), one after the other... enjoy the link below.
 
> The main question this raises is "How lightweight are threads?"
> Can I program with dozens or hundreds of python threads in a
> program (for example under Windows) and not notice that this is
> an inefficient or inept coding style?

this one is for you :-)
http://www-106.ibm.com/developerworks/linux/library/l-pythrd.html

you wont get happy with hundrets of native threads, but with the light ones 
from above you can have thousands...

generaly you will find interesting stuff here (one line):
http://www-
106.ibm.com/developerworks/views/linux/articles.jsp?sort_order=desc&expand=
&sort_by=Date&show_abstract=true&view_by=Search&search_by=charming+python%3
A

chris
-- 
Chris <cliechti at gmx.net>





More information about the Python-list mailing list