[Python-ideas] asyncore: included batteries don't fit
Terry Reedy
tjreedy at udel.edu
Thu Oct 11 22:44:46 CEST 2012
On 10/11/2012 2:45 PM, Guido van Rossum wrote:
> Tue, Oct 9, 2012 at 5:44 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> You might like to take a look at this, where I develop a series of
>> examples culminating in a simple multi-threaded server:
>>
>> http://www.cosc.canterbury.ac.nz/greg.ewing/python/generators/yf_current/Examples/Scheduler/scheduler.txt
>
> Definitely very enlightening. Though I think you should not use
> 'thread' since that term is already reserved for OS threads as
> supported by the threading module. In NDB I chose to use 'tasklet' --
I read through this also and agree that using 'thread' for 'task',
'tasklet', 'micrethread', or whatever is distracting. Part of the point,
to me, is that the code does *not* use (OS) threads and the thread module.
Tim Peters intended iterators, including generators, to be an
alternative to what he viewed as 'inside-out' callback code. The idea
was that pausing where appropriate allowed code that belongs together to
be kept together. I find generator-based event loops to be somewhat
easier to understand than callback-based loops. I certainly was more
comfortable with Greg's example than what I have read about twisted. So
I would like to see a generator-based system in the stdlib.
--
Terry Jan Reedy
More information about the Python-ideas
mailing list