Explicit yield points makes reasoning about multitasking much easier. The
author of Twisted wrote an excellent post about this.[1] I agree that the
Python documentation doesn't do justice to the question, "when should I use
asyncio instead of threads?"
[1]
Am 24.01.2018 um 17:59 schrieb Steven D'Aprano:
On Wed, Jan 24, 2018 at 05:46:29PM +0100, Thomas Güttler wrote:
I found a question and answer at Stackoverflow[1] which says
that asyncio/await is like cooperative multitasking.
My whish is to have preemptive multitasking: The interpreter
does
If I'm understanding correctly, the interpreter already does this with
threads. About every 15 milliseconds the interpreter will stop a thread and
see if there are any others to work on, see "Grok the GIL," blog:
https://emptysqua.re/blog/grok-the-gil-fast-thread-safe-python/ or the
PyCon talk:
On Wed, Jan 24, 2018 at 05:46:29PM +0100, Thomas Güttler wrote:
> I found a question and answer at Stackoverflow[1] which says
> that asyncio/await is like cooperative multitasking.
>
> My whish is to have preemptive multitasking: The interpreter
> does the yielding.
Isn't that what threading
On Thu, Jan 25, 2018 at 3:46 AM, Thomas Güttler
wrote:
> I found a question and answer at Stackoverflow[1] which says
> that asyncio/await is like cooperative multitasking.
"Like"? It *is* a form of co-operative multitasking.
> My whish is to have preemptive
I found a question and answer at Stackoverflow[1] which says
that asyncio/await is like cooperative multitasking.
My whish is to have preemptive multitasking: The interpreter
does the yielding. The software developer does not need to
insert async/await keywords into its source code any more.