frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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.

Removing the Modem and GPS from My 2024 RAV4 Hybrid

https://arkadiyt.com/2026/05/13/removing-the-modem-and-gps-from-my-rav4/
116•arkadiyt•1h ago•33 comments

RTX 5090 and M4 MacBook Air: Can It Game?

https://scottjg.com/posts/2026-05-05-egpu-mac-gaming/
251•allenleee•2h ago•71 comments

New Nginx Exploit

https://github.com/DepthFirstDisclosures/Nginx-Rift
87•hetsaraiya•1h ago•26 comments

Computer Hobby Movement in Canada

https://museum.eecs.yorku.ca/exhibits/show/hobby_canada/hobby_canada
141•rbanffy•5h ago•36 comments

HDD Firmware Hacking

https://icode4.coffee/?p=1465
34•jsploit•2h ago•1 comments

MIT: 20% drop in incoming graduate students

https://president.mit.edu/writing-speeches/video-transcript-message-president-kornbluth-about-fun...
442•dmayo•3h ago•443 comments

Fossils show millipede and centipede ancestors evolved legs underwater

https://phys.org/news/2026-05-ancient-sea-fossils-millipede-centipede.html
37•gmays•2d ago•2 comments

Claude AI recovers an 11 yrs old BTC wallet holding 400k USD

https://www.tomshardware.com/tech-industry/cryptocurrency/bitcoin-trader-recovers-usd400-000-usin...
261•cednore•3h ago•133 comments

Terranox AI (YC W26) Is Hiring a Founding AI/ML Engineer and Summer AI/ML Intern

https://www.workatastartup.com/companies/terranox-ai
1•jadecheclair•1h ago

EditLens: Quantifying the extent of AI editing in text (2025)

https://arxiv.org/abs/2510.03154
16•horseradish•23h ago•0 comments

On The Conflation of Money and Things

https://lithub.com/is-it-even-real-on-the-conflation-of-money-and-things/
35•bookofjoe•2h ago•10 comments

Int a = 5; a = a++ + ++a; a =? (2011)

https://gynvael.coldwind.pl/?id=372
7•e-topy•2d ago•8 comments

Claude for Small Business

https://www.anthropic.com/news/claude-for-small-business
484•neilfrndes•14h ago•431 comments

60fps Video on a CGA? – The GlyphBlaster

https://martypc.blogspot.com/2026/05/60fps-video-on-cga-glyphblaster.html
38•tambourine_man•4d ago•6 comments

Show HN: Running the second public ODoH relay

https://numa.rs/blog/posts/odoh-anonymous-dns-without-an-account.html
100•rdme•7h ago•32 comments

Bun's Rust rewrite has been merged

https://old.reddit.com/r/rust/comments/1tcrmjs/rewrite_bun_in_rust_has_been_merged/
49•ale•49m ago•37 comments

Scorched Earth 2000 – Web

http://www.scorch2000.com/web/
359•meshko•17h ago•140 comments

Myths about /dev/urandom (2014)

https://www.2uo.de/myths-about-urandom/
72•signa11•7h ago•36 comments

The Tree House: A voyage to the source of a backyard dream

https://www.laphamsquarterly.org/roundtable/tree-house
57•Caiero•2d ago•6 comments

Apple-OpenAI Relationship Frays, Setting Up Possible Legal Fight

https://www.bloomberg.com/news/articles/2026-05-14/openai-apple-partnership-frays-setting-up-poss...
30•helsinkiandrew•1h ago•11 comments

Anthropic forms $200M partnership with the Gates Foundation

https://www.anthropic.com/news/gates-foundation-partnership
97•surprisetalk•3h ago•70 comments

Sam Altman's Business Dealings Under GOP Scrutiny Ahead of OpenAI's IPO

https://www.wsj.com/tech/ai/sam-altmans-business-dealings-under-gop-scrutiny-ahead-of-openais-ipo...
166•1vuio0pswjnm7•5h ago•115 comments

Leaving the Physical World

https://www.eff.org/pages/leaving-physical-world
153•andsoitis•4d ago•66 comments

Deal reached with hackers to delete data stolen from the Canvas platform

https://www.nbcnews.com/tech/tech-news/deal-reached-hackers-delete-data-stolen-canvas-educational...
15•fortran77•41m ago•9 comments

USDA Projects Smallest US Wheat Harvest Since 1972 Due to Plains Drought

https://www.agweb.com/news/usda-projects-smallest-us-wheat-harvest-1972-due-plains-drought
207•littlexsparkee•5h ago•134 comments

A Claude Code and Codex Skill for Deliberate Skill Development

https://github.com/DrCatHicks/learning-opportunities
189•cdrnsf•15h ago•43 comments

Saying Goodbye to one line of APL

https://homewithinnowhere.com/posts/2026-05-10-one-line.html#fnref1
65•tosh•3d ago•19 comments

MacBook Neo Deep Dive: Benchmarks, Wafer Economics, and the 8GB Gamble

https://www.jdhodges.com/blog/macbook-neo-benchmarks-analysis/
318•tosh•23h ago•370 comments

Pipes, Forks, and Zombies

https://cs61.seas.harvard.edu/wiki/2017/Shell3/
36•tosh•7h ago•5 comments

The Emacsification of Software

https://sockpuppet.org/blog/2026/05/12/emacsification/
393•rdslw•1d ago•244 comments