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.

GPT-6 Astra

https://openai.com/index/gpt-6-astra/
782•kibae•2h ago•507 comments

Qwen 3.8 27B available on Cerebras at 1500 tokens/s

https://inference-docs.cerebras.ai/models/overview
304•altertable•2h ago•100 comments

.name Termination

https://neil.fraser.name/news/2026/09/03/
1057•pavel_lishin•6h ago•317 comments

The largest electric aircraft just flew [video]

https://www.youtube.com/watch?v=nM86DBOqgPM
51•feb•2d ago•33 comments

Any Human Ever – One life, drawn at random from all who have ever lived

https://anyhumanever.com/
354•thinkingemote•6h ago•162 comments

Tasklet (YC P26) Is Hiring a Customer Success Engineer

https://tasklet.ai/careers/customer-success-engineer
1•mayop100•13m ago

K2 Horizon: A connected fleet of six open models

https://ifm.ai/blog/k2/
210•karimf•5h ago•71 comments

Porting my 1993 Amiga game to Godot, with an LLM reading the 68000 assembly

https://babyloniantwins.com/blog/porting-a-1993-amiga-game-to-godot/
109•rabahs•6h ago•39 comments

The death of San Francisco's Market Street

https://www.noahpinion.blog/p/the-death-of-market-street
33•A_D_E_P_T•1h ago•35 comments

Artificial beaver dams saw juvenile coho salmon survival rates go from 8% to 60%

https://www.discoverwildlife.com/animal-facts/artificial-beaver-dams-california
82•speckx•4h ago•24 comments

Unusual Suspects

https://neal.fun/unusual-suspects/
60•beeperboy95•1d ago•16 comments

OpenAI's GPT-6 Astra on ARC-AGI-3

https://arcprize.org/blog/astra
70•vignesh_warar•1h ago•33 comments

The true horror of Edgar Allan Poe’s stories lies in their confessions

https://yalereview.org/article/emily-ogden-edgar-allan-poe
29•lermontov•1d ago•8 comments

GPS glitched across the US by as much as 33 feet

https://www.sciencealert.com/gps-glitched-across-the-us-by-as-much-as-33-feet-scientists-have-nev...
59•thread_id•20h ago•15 comments

Xanadu was waiting for agents

https://zed.dev/blog/agentic-xanadu
31•nsm•2d ago•10 comments

Audacity 4.0

https://github.com/audacity/audacity/releases/tag/Audacity-4.0.0
974•ClydeN•10h ago•217 comments

The asteroid currently hitting front end web development

https://nolanlawson.com/2026/08/23/the-asteroid-currently-hitting-frontend-web-development/
30•codechicago277•1h ago•18 comments

Static Allocation, Constant Work

https://matklad.github.io/2026/09/02/static-allocation-constant-work.html
86•surprisetalk•1d ago•14 comments

VC isn't VC anymore

https://www.anildash.com/2026/09/02/cancer-capital/
152•cdrnsf•23h ago•139 comments

Gloria Steinem has died

https://www.theguardian.com/books/2026/sep/03/gloria-steinem-groundbreaking-feminist-campaigner-d...
82•mellosouls•10h ago•29 comments

Ask HN: Why were OpenAI, Claude, and Grok simultaneously down?

278•halcdev•6h ago•492 comments

Launch HN: Mireye (YC S26) – Infrastructure for Physical World AI Agents

25•anshchokshi•4h ago•2 comments

Dextroproporphan: An Analogue for a Better Dextromethorphan

https://monfak.top/blog/posts/dextroproporphan
7•znano•1d ago•3 comments

Go grandmaster Shin defeats AI KataGo with a two-stone handicap

https://www.kedglobal.com/artificial-intelligence/newsView/ked202607210007
99•gmays•20h ago•25 comments

How concerned should we be about Astra's recurrent architecture?

https://www.lesswrong.com/posts/PLisnSFir8y5AHkmP/how-concerned-should-we-be-about-astra-s-recurrent
45•yurivish•4h ago•23 comments

Google Antigravity TOS: 3rd party usage can get Google account suspended

https://twitter.com/GergelyOrosz/status/2095453567955968398
225•tosh•10h ago•162 comments

How to get a free .arpa domain

https://hawksley.dev/blog/get-free-arpa-domain
86•ethanhawksley•2d ago•10 comments

“We want it to really confuse people, but also really make people happy”

https://unsung.aresluna.org/we-want-it-to-really-confuse-people-but-also-really-make-people-happy/
45•zdw•4d ago•13 comments

Astronomers Detect a 10-Sided Structure in Saturn's Atmosphere

https://www.sciencealert.com/astronomers-spot-an-uncannily-geometric-10-sided-structure-in-saturn...
77•jjgreen•7h ago•30 comments

Pre-Release of Polars 2.0

https://pola.rs/posts/announcing-polars-2/
367•komape•14h ago•121 comments