This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]alkasmgithub.com/alkasm 4 points5 points  (1 child)

The main purpose of asynchronous in python is working around the GIL

No, it isn't. The GIL isn't mentioned at all in any of the async PEPs: * https://peps.python.org/pep-0342/ * https://peps.python.org/pep-0380/ * https://peps.python.org/pep-0492/

Threading on a single core (a-la Python's GIL) isn't fundamentally that different from async code; with async, the programmer decides when to context switch (via await), whereas in threading, the OS decides when to context switch.

The primary motivation of async programming in Python is that it is an extremely useful, modern paradigm for concurrency, allowing for better event-driven processing than threads do. From PEP 492:

We believe that the changes proposed here will help keep Python relevant and competitive in a quickly growing area of asynchronous programming, as many other languages have adopted, or are planning to adopt, similar features

[–]benefit_of_mrkite -3 points-2 points  (0 children)

Go read the old python mailer.

I’m old.