On 2016-10-30 17:58, Guido van Rossum wrote:
Regarding the documentation, I doubt we can get it in shape just by
filing issues. We should really just have a tutorial written by
someone with a good understanding of asyncio and writing skills.

From my experience, I had to understand how "single-threaded concurrent
code using coroutines" works. It is another concurrent programming model
and maybe description of how coroutines can be used for multitasking
(*without* asyncio) should be part of official Python tutorial after
multithreading section? [1]

Then asyncio documentation could simply refer to the tutorial and say that
asyncio is using that model and is for "multiplexing I/O access over
sockets and other resources". Of course, it is also provider of
"infrastructure for writing single-threaded concurrent code using
coroutines", but...

Before asyncio, I was using coroutines for dataflow programming and
somehow never realized the "concurrent model" part. When I was starting
to use asyncio, I got an impression that it is required for coroutine
concurrent programming, which is not true. Once I separated these two
things in my head, it was easier to understand the need of event loop
to schedule asynchronous I/O tasks and event loop using futures to
represent these tasks... and the rest seems to be just an extension
to provide more functionality.

Above is quite personal perspective, but maybe it makes sense not only
for me? :)

Regards,

w

[1] To contrast concurrent execution of coroutines and threads,
beside Glyph's famous blog post, the "Nondeterminism of Threads"
frame at 2nd page of http://escholarship.org/uc/item/63b2c5cz could
be inspiring as well, IMHO.

Reply via email to