<p>+10 for greenlet style coroutines. It's a very modern feature and will put python in an excellent position. Also nick your points about asynchronous io being the main use case are spot on as far as I'm concerned. </p>
<div class="gmail_quote">On Oct 31, 2011 8:49 AM, "Nick Coghlan" <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Oct 31, 2011 at 7:16 AM, Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br>
> Nick Coghlan wrote:<br>
><br>
>> The fact that greenlets exists (and works) demonstrates that it is<br>
>> possible to correctly manage and execute multiple Python stacks within<br>
>> a single OS thread.<br>
><br>
> I'm not convinced that greenlets work correctly under all<br>
> possible circumstances. As I understand, they work by copying<br>
> pieces of C stack in and out when switching tasks. That<br>
> fails if a pointer to local storage is kept anywhere that<br>
> can be reached by a different task. I seem to remember there<br>
> being an issue with Tk doing something like this and causing<br>
> problems for Stackless.<br>
<br>
Yeah, that sentence should have had a "mostly" inside the parentheses :)<br>
<br>
However, I think it may be more fruitful to pursue an approach that<br>
uses greenlets as the foundation, and works to close the loopholes<br>
(e.g. by figuring out a way for C code to mark itself as "coroutine<br>
safe" and assuming it is not safe by default) rather than trying to<br>
figure out how to make a "generators all the way down" approach handle<br>
invocation of arbitrary slots.<br>
<br>
Cheers,<br>
Nick.<br>
<br>
--<br>
Nick Coghlan | <a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a> | Brisbane, Australia<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</blockquote></div>