<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 23, 2012, at 6:51 PM, Andrew Francis <<a href="mailto:andrewfr_ice@yahoo.com">andrewfr_ice@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Hi Benoit and folks:</span></div><div style="color: rgb(69, 69, 69); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br></span></div><div style="color: rgb(69, 69, 69); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">>Message: 3</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica,
 sans-serif; font-size: 12px; ">>Date: Tue, 23 Oct 2012 09:19:59 +0200</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">>From: Benoit Chesneau <</span><a ymailto="mailto:benoitc@gunicorn.org" href="mailto:benoitc@gunicorn.org" style="color: rgb(35, 71, 134); outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span class="yshortcuts" id="lw_1351010028_8" style="cursor: pointer; color: rgb(54, 99, 136); ">benoitc@gunicorn.org</span></a><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">></span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif;
 font-size: 12px; ">>To: Guido van Rossum <</span><a ymailto="mailto:guido@python.org" href="mailto:guido@python.org" style="color: rgb(35, 71, 134); outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">guido@python.org</a><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">></span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">>Cc: Python-Ideas <</span><a ymailto="mailto:python-ideas@python.org" href="mailto:python-ideas@python.org" style="color: rgb(35, 71, 134); outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">python-ideas@python.org</a><span style="color: rgb(69, 69, 69); font-family:
 Arial, Helvetica, sans-serif; font-size: 12px; ">></span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">>Subject: Re: [Python-ideas] yield from multiple iterables (was Re: The</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "> >   async    API of the future: yield-from)</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">>Message-ID: <</span><a ymailto="mailto:BE74DBDE-1965-47F0-99B9-27F0C7CD574C@gunicorn.org" href="mailto:BE74DBDE-1965-47F0-99B9-27F0C7CD574C@gunicorn.org" style="color: rgb(35, 71, 134); outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span class="yshortcuts" id="lw_1351010028_9" style="cursor: pointer; color: rgb(54, 99, 136); ">BE74DBDE-1965-47F0-99B9-27F0C7CD574C@gunicorn.org</span></a><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">></span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">>Content-Type: text/plain; charset=windows-1252</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(54,
 99, 136); ">(I learnt about this mailing list from Christian Tismer's post in the Stackless mailing list and I am catching up)</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">>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:</span></div><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><br></div><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><span style="color: rgb(69, 69, 69); ">>- 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.</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br><br>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. </div></div></div></blockquote><div><br></div>Indeed :) I would have say Plan 9 and tasks inside but right channnels are in limbo too.</div><div><br><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><br></div><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; ">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 <span style="background-color: transparent; ">prototype parts of Go's model that are not present in Stackless, i.e. the select (ALT) language feature. </span></div><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><span style="background-color: transparent; ">Rob Pike and Russ </span><span style="background-color: transparent; ">Cox were really helpful in answering my questions. Newer stackless.py implementations use </span></div><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color:
 transparent; font-style: normal; "><span style="background-color: transparent; ">continuelets so look for an older PyPy implementation. </span></div></div></div></blockquote><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><span style="background-color: transparent; "><br></span></div><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><span style="background-color: transparent; ">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."</span></div></div></div></blockquote><div><br></div>Yes saw that. And actually some part of the Task code is based on stackless.py  but using greenlets, Channels have been slightly modified to be thread-safe and support buffering. Did you release your code somewhere ? It could be interesting to put the experience further.<br><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div style="color: rgb(54, 99, 136); font-size: 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; "><br></div><div style="color: rgb(54, 99, 136); font-size:
 12px; font-family: Arial, Helvetica, sans-serif; background-color: transparent; font-style: normal; ">For networking support, I run Twisted as a tasklet. There are a few tricks to make Stackless and Twisted co-operate.<br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "></div></div></div></blockquote><div><br></div>I plan to release a new version of flower this week. For now i am also running a libuv eventloop in a tasklet, but since the tasklet need to be blocking for performance, i am writing some new code to run the tasklet in its proper thread when needed. Not sure how it will go.</div><div><br></div><div>Current implementation handle events when the scheduler come on the eventloop which isn't the more efficient way imo.</div><div><br></div><div>Another thing to considers is also rust. Rust is using libuv and put the eventloop in its own task thread :</div><div><br></div><div><a href="http://dl.rust-lang.org/doc/0.4/std/uv_global_loop.html">http://dl.rust-lang.org/doc/0.4/std/uv_global_loop.html</a></div><div><br></div><div>I find this idea quite elegant.</div><div><br></div><div>Best,</div><div><br></div><div>- benoît<br><blockquote type="cite"><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div><br></div>  </div></blockquote></div><br></body></html>