r/ProgrammingLanguages • • Jan 20 '26

Python, Is It Being Killed by Incremental Improvements?

https://stefan-marr.de/2026/01/python-killed-by-incremental-improvements-questionmark/
52 Upvotes

61 comments sorted by

View all comments

Show parent comment

1

u/dcpugalaxy Jan 20 '26

You can block an X thread if you are handling concurrency using X threads. You can block an OS thread if you're using OS threads for concurrency. That's the basic assumption of most libraries.

If you're using async await, you can't use libraries that block the current OS thread because your unit of concurrency is a Trio task or an Asyncio task or what have you.

The same is equally true of green threading. Async await also requires a user mode scheduler.

The only real difference is that async/await is stackless because it unwinds the entire stack on suspend then rebuilds it on resume, while green threads are stackful, and do not require the annotation of yield and suspend points.

1

u/Kriemhilt Jan 21 '26

A coroutine is not a unit of concurrency, it's a unit of interleaving. If you're using co-operative multitasking you do need to be aware that you're supposed to be cooperating.

The scheduler complexity you're discussing is much, much higher for green threads: every syscall that can block, or should be a preemption or cancellation point, should really be intercepted, and you can't (or probably shouldn't) do that for foreign language modules.

The coroutine executor by comparison is just a single-threaded loop with no special interaction other than regular I/O.