Python has had async for 10 years – why isn't it more popular?
241–250 of 305 posts
Re: Python has had async for 10 years – why isn't it more popular?
#242Earlier quoted context omitted.
> But all it did was show us that async code just plain sucks compared to green thread code that can just block, instead of having to do the async dances. I take so much flak for this opinion at work, but I agree with you 100%. Code that looks synchronous, but is really async, has funny failure modes and idiosyncracies, and I generally see more bugs in the async parts of our code at work. Maybe I’m just old, but I do…
I'm a person who wrote an entire networking library in Python and I agree with you. The most obvious issue with Python's single-threaded async code is any slow part of the program delays the entire thing. And yeah -- that's actually insanely frigging difficult to avoid. You write standard networking code and then find out that parts you expected to be async in Python actually ended up being sync / blocking. DESPITE T…
Re: Python has had async for 10 years – why isn't it more popular?
#243Earlier quoted context omitted.
I'm a person who wrote an entire networking library in Python and I agree with you. The most obvious issue with Python's single-threaded async code is any slow part of the program delays the entire thing. And yeah -- that's actually insanely frigging difficult to avoid. You write standard networking code and then find out that parts you expected to be async in Python actually ended up being sync / blocking. DESPITE T…
bottle.py is a WSGI backed framework, right? So it's agnostic about whether you are running with threads, fork, blocking single thread IO, gevent, or what.
Re: Python has had async for 10 years – why isn't it more popular?
#244This is sort of like the article's Problem 3, but it's not just maintaining two APIs, it's even creating the second API in the first place.
Re: Python has had async for 10 years – why isn't it more popular?
#245It was supposed to bring massive concurrency to Python. But as with any async implantation in any language it is too easy to deadlock the entire system. Did you forgot to sprinkle enough `await`? Your code is blocked somewhere, good luck hunting for it. In contrast preemptive green threads are too easy. Be it IO or CPU load all threads will get their slice of CPU time. Nothing is blocked so you can debug your logic e…
What I find funny is Java started with green threads, then moved away to system threads, then back again.
Some time ago I tried to run just 10k OS threads on a small PC and it just crashed. So clearly OS threads have not improved much.
Re: Python has had async for 10 years – why isn't it more popular?
#246Earlier quoted context omitted.
GIL is not part of the language design, it's just a detail of the most common implementation - CPython.
Fair and accurate. But that’s pretty much what people use, right? I am happy to hear stories of using pypy or something to radically improve an architecture. I don’t have any from personal experience. I guess twisted and stackless, a long time ago.
Re: Python has had async for 10 years – why isn't it more popular?
#247I really tried to make it work, but eventually gave up and went back to deque. Now life is great.
Re: Python has had async for 10 years – why isn't it more popular?
#248I used to keep plugging Unyielding [1] vs. What Color Is Your Function [2] as the right matrix to view these issues within. But then Notes on structured concurrency [3] was written and I just point to that these days. But, to sum it all up for those who want to talk here, there are several ways to look at concurrency but only one that matters. Is my program correct? How long will it take to make my program correct? S…
I already kinda had this idea while working with Rust. In Rust, Futures won’t execute unless `await`ed. In practice, that meant that all my futures were joined. It was just the only way I could wrap my head around doing anything useful with async.
Re: Python has had async for 10 years – why isn't it more popular?
#249Earlier quoted context omitted.
No it was a js dev complaining about callbacks in node. Mainly because a lot of standard library code back then only came in callback flavour. i.e. no sync file writes, etc.
Which is really funny because the linux kernel doesn't do async for file writes :D