frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

How async/await works in Python (2021)

https://tenthousandmeters.com/blog/python-behind-the-scenes-12-how-asyncawait-works-in-python/
61•sebg•1y ago

Comments

quentinp•1y ago
While it stays at the Python level, https://github.com/AndreLouisCaron/a-tale-of-event-loops really helped me to understand how asyncio and Trio are implemented. I had no idea how sleeps worked before reading that post.
incomingpain•1y ago
Page didnt load for me.

https://realpython.com/async-io-python/

Multiprocessing all the way!

emmelaich•1y ago
(2021)

Good article!

punnerud•1y ago
A more simplified version:

Synchronous code is like a single-lane road where cars (tasks) must travel one after another in perfect sequence. If one car stops for gas (waiting for I/O), every car behind it must stop too. While orderly and predictable, this creates massive traffic jams as tasks wait unnecessarily for others to complete before they can proceed.

Pure asynchronous code (with callbacks) is like dispatching multiple cars onto independent routes with no coordination. Cars move freely without waiting for each other, but they arrive at unpredictable times and following their progress becomes chaotic. It's efficient but creates a complex tangle of paths that becomes hard to maintain.

Async/await combines the best of both approaches with a multi-lane highway system. Cars follow clear, synchronous-looking routes (making code readable), but only wait at strategic "await" exit ramps when truly necessary. When a car needs data, it signals with "await", pulls off the highway temporarily, and other cars continue flowing past. Once its operation completes, it merges back into traffic and continues. This gives you the logical simplicity of synchronous code with the performance benefits of asynchronous execution - cars only wait at crossroads when they must, maximizing throughput while maintaining order.

The genius of async/await is that it lets developers write code that looks sequential while the runtime handles all the complex traffic management under the hood.

explodes•1y ago
Excellent write up. I appreciate the level of details here showing the history from the days of old, before async/await were even keywords.
bilsbie•1y ago
How does the GIL come into play here?
punnerud•1y ago
GIL is like a "red-cap" on the head for the CPU-core running the task, so you would not be able to run true Async without GIL. Have to hand the "red-cap" back, for the next task.

Instead of using a global lock ("red-cap"), Python objects have introduced a specialized reference counting system that distinguishes between "local" references (owned by a single thread) and "shared" references (accessed by multiple threads).

In that way enabling to remove GIL in the long run, now starting with making it optional.

AI doesn't generate working products, that's still your job

https://weeraman.com/the-prototype-isnt-the-product/
136•smckk•3h ago•115 comments

Elevators

https://john.fun/elevators
1338•Jrh0203•20h ago•326 comments

Flint: A Visualization Language for the AI Era

https://microsoft.github.io/flint-chart/
137•vinhnx•8h ago•48 comments

How to Do Great Work (2023)

https://paulgraham.com/greatwork.html
31•tosh•3h ago•17 comments

RamenHaus

https://ramen.haus/
100•oler•2h ago•52 comments

qm – Multiplayer agent harness for work

https://github.com/yc-software/qm
586•tosh•17h ago•121 comments

How to Exist

https://www.raptitude.com/2026/07/how-to-exist/
229•walterbell•11h ago•127 comments

The development pipeline is a production system

https://sundry.jerryorr.com/2026/07/31/development-pipeline-is-a-production-system
93•firefoxd•8h ago•39 comments

Solid Queue 1.6.0 now supports fiber workers

https://github.com/rails/solid_queue/releases/tag/v1.6.0
17•earcar•3h ago•2 comments

Software for One

https://www.ajwaxman.com/writing/software-for-one
131•awaxman11•2d ago•110 comments

G'mic 4.0: Squaring the Pixel, Easier

https://gmic.eu/gmic40/
35•dtschump•2d ago•2 comments

Manual: •.,:;?·

https://type.today/en/journal/dots
5•behnamoh•2d ago•0 comments

A tiny holdout building in the middle of Macy’s is back in view

https://ephemeralnewyork.wordpress.com/2026/07/27/hidden-by-billboards-for-over-100-years-the-tin...
44•donohoe•3d ago•10 comments

Ten advances in mathematics and theoretical computer science

https://openai.com/index/ten-advances-in-mathematics/
146•milkshakes•4h ago•105 comments

Google fixed more Chrome bugs in June than over the past two years, thanks to AI

https://blog.google/security/chrome-stronger-with-every-update/
532•Garbage•1d ago•545 comments

The Absurdity of Albert Camus

https://www.historytoday.com/archive/portrait-author-historian/absurdity-albert-camus
135•apollinaire•1d ago•58 comments

Run Kimi K3 using 29 GB of RAM at 0.50 tok/s

https://github.com/sqliteai/waste
265•marcobambini•21h ago•111 comments

Attention Decode on AMD MI450 GPUs: A Gluon Kernel Optimization Guide

https://rocm.blogs.amd.com/software-tools-optimization/gluon-attention-decode-mi450/README.html
44•matt_d•4d ago•0 comments

Ten Ways NAS Is Getting Enshitified

https://nascompares.com/2026/07/31/the-10-ways-nas-is-getting-enshitified/
106•giuliomagnifico•6h ago•96 comments

Getting 25 Gbps Thunderbolt Ethernet on My Mac Studio

https://www.jeffgeerling.com/blog/2026/getting-25g-ethernet-mac-thunderbolt/
192•speckx•19h ago•98 comments

Progressive Web Components

https://arielsalminen.com/2026/progressive-web-components/
158•hosteur•1d ago•32 comments

June in Servo: real world compat, media queries, SharedWorker, and more

https://servo.org/blog/2026/07/31/june-in-servo/
161•iamnothere•17h ago•50 comments

Big Food vs. the People

https://www.lighthousereports.com/investigation/big-food-vs-the-people/
235•jruohonen•19h ago•149 comments

Increasing the lifespan of a bulb makes it worse in every other way

https://maurycyz.com/misc/tungsten/
99•tonyg•1d ago•104 comments

Long Range Wi-Fi – Pushing 2.4 GHz Wi-Fi to the limits (2019)

https://www.phidgets.com/?view=articles&article=LongRangeWifi
60•rzk•3d ago•35 comments

Golang proposal: container/: generic collection types

https://github.com/golang/go/issues/80590
161•jabits•16h ago•132 comments

AWS Secrets Manager Terraform: Least-Privilege Access

https://blog.victorsilva.com.uy/aws-secrets-manager-terraform-least-privilege/
17•meysamazad•3d ago•0 comments

The most official water costs $120k a gallon

https://signoregalilei.com/2026/07/26/the-most-official-water-costs-120000-a-gallon/
199•surprisetalk•20h ago•151 comments

Let's make the worst Htmx

https://zserge.com/posts/worst-htmx-ever/
107•RebelPotato•1d ago•35 comments

Demystifying DRAM Read Disturbance: RowHammer and RowPress Phenomena

https://arxiv.org/abs/2607.28233
52•Jimmc414•14h ago•33 comments