[Python-ideas] Preemptive multitasking and asyncio

Mark E. Haase mehaase at gmail.com
Thu Jan 25 09:37:12 EST 2018


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]  https://glyph.twistedmatrix.com/2014/02/unyielding.html

On Thu, Jan 25, 2018 at 2:37 AM, Thomas Güttler <
guettliml at thomas-guettler.de> wrote:

>
>
> 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 the yielding.
>>>
>>
>> Isn't that what threading and multiprocessing do?
>>
>
> Hmmm, yes, you are right.
>
> I guess I have not understood something up to now.
> If async/await is the answer. What was the question?
> AFAIK it can help to solve the c10k problem.
>
> If I don't have the c10k problem, then what is the benefit of async/await?
>
> If it is only about IO, there are python bindings for libraries like libuv.
>
> I guess this whole topic is too ...(I am missing the right term here)...
> for
> average developers like me.
>
> Regards,
>   Thomas Güttler
>
>
> --
> Thomas Guettler http://www.thomas-guettler.de/
> I am looking for feedback: https://github.com/guettli/pro
> gramming-guidelines
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180125/85fe9d5c/attachment.html>


More information about the Python-ideas mailing list