[Python-ideas] yield from multiple iterables (was Re: The async API of the future: yield-from)

Andrew Francis andrewfr_ice at yahoo.com
Tue Oct 23 18:51:21 CEST 2012


Hi Benoit and folks:

>Message: 3
>Date: Tue, 23 Oct 2012 09:19:59 +0200
>From: Benoit Chesneau <benoitc at gunicorn.org>
>To: Guido van Rossum <guido at python.org>
>Cc: Python-Ideas <python-ideas at python.org>
>Subject: Re: [Python-ideas] yield from multiple iterables (was Re: The
 >   async    API of the future: yield-from)
>Message-ID: <BE74DBDE-1965-47F0-99B9-27F0C7CD574C at gunicorn.org>
>Content-Type: text/plain; charset=windows-1252

(I learnt about this mailing list from Christian Tismer's post in the Stackless mailing list and I am catching up)

>I myself toying with the idea of porting the Go concurrency model to Python [4] using greenlets and pyuv. Both the scheduler >and the way IOs are handled:

>- In Go all coroutines are independent from each others and can only communicate via channel. Which has the advantage to >allows them to run on different threads when one is blocking. In normal case they are mostly working like grrenlets on a single >thread and are simply scheduled in a round-robin way. (mostly like in stackless). On the difference that goroutines can be >executed in parallel. When one is blocking another thread will be created to handle other goroutines in the runnable queue.


What aspect of the Go concurrency model? Maybe you already know this but  Go and Stackless Python share a common ancestor: Limbo. More specifically the way channels work. 

This may be tangential to the discussion but in the past, I have used the stackless.py module in conjunction with CPython and greenlets to rapidly prototype parts of Go's model that are not present in Stackless, i.e. the select (ALT) language feature. 
Rob Pike and Russ Cox were really helpful in answering my questions. Newer stackless.py implementations use 
continuelets so look for an older PyPy implementation. 

I have also prototyped a subset of Polyphonic C# join patterns.  After I got the prototype running, I had an interesting discussion with the authors of "Scalable Join Patterns."

For networking support, I run Twisted as a tasklet. There are a few tricks to make Stackless and Twisted co-operate.


Cheers,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121023/3f47a3a7/attachment.html>


More information about the Python-ideas mailing list