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.

Apple introduces M6 and M5 Ultra

https://www.apple.com/newsroom/2026/08/apple-introduces-m6-and-m5-ultra-for-a-big-leap-in-perform...
750•interpol_p•6h ago•619 comments

New Mac Studio with M5 Max and M5 Ultra

https://www.apple.com/newsroom/2026/08/apple-introduces-new-mac-studio-with-m5-max-and-m5-ultra/
605•interpol_p•6h ago•357 comments

OpenAI Jalapeño: Better than Nvidia Blackwell

https://newsletter.semianalysis.com/p/openai-jalapeno-better-than-nvidia
111•bmulholland•5h ago•46 comments

Black hole singularity is a surface not a point

https://arxiv.org/abs/2608.21590
88•raattgift•2h ago•39 comments

My Friend Aaron

https://rorz.io/writing/my-friend-aaron
174•sarreph•2h ago•40 comments

FDA authorizes first wearable device that monitors ketone and blood sugar levels

https://www.fda.gov/news-events/press-announcements/fda-authorizes-first-wearable-device-continuo...
16•sunnynagra•20m ago•1 comments

Show HN: I made a Raspberry with Qwen my local car AI

https://github.com/ThinkOffApp/CarWatch
13•petruspennanen•4h ago•1 comments

Run OpenBSD on DigitalOcean for $4/month

https://nil.wallyjones.com/run-openbsd-on-digitalocean-for-4month/
48•speckx•2h ago•18 comments

New Mac mini, featuring M6 and M5 Pro

https://www.apple.com/newsroom/2026/08/apple-unveils-a-more-powerful-mac-mini-featuring-the-all-n...
341•runako•6h ago•175 comments

Clara (YC P26) is hiring a growth engineer to bring AI doctors to market

https://www.ycombinator.com/companies/clara-2/jobs/8snci6k-founding-full-stack-growth-engineer
1•gfavvas•1h ago

Nitter project received cease and desist

https://github.com/zedeus/nitter/issues/1442
255•Banditoz•2h ago•173 comments

Dolly Parton has died

https://www.theguardian.com/music/2026/aug/25/dolly-parton-country-singer-dead
475•helsinkiandrew•1h ago•72 comments

Pgbot: A 5.9 MB read-only Postgres tool for humans and agents

https://pgbot.dev/
22•sashash•56m ago•3 comments

Show HN: LatticeDB – Like SQLite but for graph databases

https://github.com/jeffhajewski/latticedb
45•smiths1999•2h ago•12 comments

Bomb fishing is wreaking havoc on Indonesia's coral reefs

https://e360.yale.edu/digest/bomb-fishing-coral-reefs
182•speckx•4h ago•111 comments

Tracking Costco gas prices

https://www.jack.bio/blog/costco-gas-tracking
33•lafond•1d ago•19 comments

Starbase, LA

https://www.spacex.com/sites/starbase-la
100•bilsbie•2h ago•114 comments

Building a backyard office, the build and cost breakdown

https://www.imkylelambert.com/articles/building-a-backyard-office-the-build-and-cost-breakdown
167•surprisetalk•5h ago•139 comments

Don't Wordle

https://dontwordle.com/
249•Hbruz0•7h ago•104 comments

Tooltips need a delay, and then they need to skip it

https://blog.master.dev/tooltips-need-a-delay-and-then-they-need-to-skip-it/
52•ibobev•2h ago•10 comments

A new ceiling for Λ: the de Bruijn–Newman constant

https://www.judegomila.com/posts/riemann-lambda-0.1787854
30•judegomila•2h ago•4 comments

Firefox 157 will include JPEG XL by default on all platforms

https://groups.google.com/a/mozilla.org/g/dev-platform/c/3YMV4MS34KA?pli=1
80•yboris•1h ago•9 comments

Fuzzing the Gleam Compiler

https://www.kurz.net/posts/fuzzing-gleam-compiler
23•crowdhailer•2h ago•1 comments

Behaviorally fingerprinting Ox Alpha's provenance

https://www.ctgt.ai/research/behaviorally-fingerprinting-ox-alphas-provenance
6•cgorlla•4h ago•1 comments

Dolly Parton Has Died

https://en.wikipedia.org/wiki/Dolly_Parton
30•ColinWright•44m ago•2 comments

Visualizing Binary Files

https://movq.de/blog/postings/2026-08-05/0/POSTING-en.html
38•zdw•1d ago•11 comments

Show HN: Lightweight system monitor for Linux VPS written in Go

https://github.com/leodeim/vpsmon
20•ygagaga•2h ago•8 comments

Warnock: Harnessing GPU geometry amplification for vector graphics

https://dl.acm.org/doi/pdf/10.1145/3820012
27•coffeeaddict1•4h ago•2 comments

Run Minecraft in a Windows sandbox for computer use agents

https://cua.ai/docs/how-to-guides/sandbox/minecraft
17•someguy101010•3h ago•6 comments

Solving the 1+N Query Problem

https://acadia.engineering/blog/solving-the-1-plus-N-query-problem
31•wheatBread•7h ago•20 comments