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•12mo ago

Comments

quentinp•12mo 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•12mo ago
Page didnt load for me.

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

Multiprocessing all the way!

emmelaich•12mo ago
(2021)

Good article!

punnerud•12mo 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•12mo 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•12mo ago
How does the GIL come into play here?
punnerud•12mo 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.

Google broke reCAPTCHA for de-googled Android users

https://reclaimthenet.org/google-broke-recaptcha-for-de-googled-android-users
258•anonymousiam•3h ago•75 comments

AI is breaking two vulnerability cultures

https://www.jefftk.com/p/ai-is-breaking-two-vulnerability-cultures
155•speckx•4h ago•65 comments

You gave me a u32. I gave you root. (io_uring ZCRX freelist LPE)

https://ze3tar.github.io/post-zcrx.html
77•MrBruh•2h ago•38 comments

Cartoon Network Flash Games

https://www.webdesignmuseum.org/flash-game-exhibitions/cartoon-network-flash-games
234•willmeyers•5h ago•73 comments

Non-determinism is an issue with patching CVEs

https://flox.dev/blog/achieving-rapid-cve-remediation-in-an-era-of-escalating-vulnerabilities/
18•mathewpregasen•59m ago•5 comments

Serving a website on a Raspberry Pi Zero running in RAM

https://btxx.org/posts/memory/
174•xngbuilds•7h ago•70 comments

Looking at the data behind prediction markets

https://asteriskmag.com/issues/14/are-prediction-markets-good-for-anything
20•kqr•1d ago•2 comments

David Attenborough's 100th Birthday

https://www.bbc.com/news/articles/cp3pww9g0p5o
323•defrost•10h ago•57 comments

Mux (YC W16) Is Hiring

https://www.mux.com/jobs
1•mmcclure•1h ago

All means are fair except solving the problem

https://yosefk.com/blog/all-means-are-fair-except-solving-the-problem.html
18•akkartik•2d ago•8 comments

An Introduction to Meshtastic

https://meshtastic.org/docs/introduction/
347•ColinWright•11h ago•135 comments

AWS says data center overheating in North Virginia disrupts services

https://www.reuters.com/business/retail-consumer/amazon-cloud-unit-says-data-center-overheating-n...
41•christhecaribou•18h ago•12 comments

My first in-prod corrupted hard drive problem

https://blog.pavementlink.ch/2026/05/07/my-first-corrupted-hard-drive-problem/
30•r1chk1t•2h ago•22 comments

Dirty Frag: Universal Linux LPE

https://github.com/V4bel/dirtyfrag
11•unbeli•1h ago•1 comments

Rumors of my death are slightly exaggerated

1394•CliffStoll•2d ago•218 comments

PC Engine CPU

https://jsgroth.dev/blog/posts/pc-engine-cpu/
111•ibobev•8h ago•49 comments

Roadside Attraction

https://theoffingmag.com/essay/roadside-attraction/
12•aways•2h ago•3 comments

Mojo 1.0 Beta

https://mojolang.org/
245•sbt567•19h ago•164 comments

Teaching Claude Why

https://www.anthropic.com/research/teaching-claude-why
30•pretext•4h ago•1 comments

US Government releases first batch of UAP documents and videos

https://www.war.gov/UFO/
195•david-gpu•10h ago•305 comments

Man finds $1M worth of Yu-Gi-Oh cards in a dumpster

https://www.404media.co/man-finds-1-million-worth-of-yu-gi-oh-cards-in-a-dumpster/
78•danso•2d ago•19 comments

Poland is now among the 20 largest economies

https://apnews.com/article/poland-economy-growth-g20-gdp-26fe06e120398410f8d773ba5661e7aa
845•surprisetalk•9h ago•708 comments

Canvas online again as ShinyHunters threatens to leak schools’ data

https://www.theverge.com/tech/926458/canvas-shinyhunters-breach
891•stefanpie•1d ago•597 comments

Show HN: GETadb.com – every GET request creates a DB

https://www.getadb.com/
20•nezaj•6h ago•25 comments

Apple, Intel have reached preliminary chip-making deal

https://www.reuters.com/business/apple-intel-have-reached-preliminary-chip-making-deal-wsj-report...
171•scrlk•4h ago•115 comments

Maybe you shouldn't install new software for a bit

https://xeiaso.net/blog/2026/abstain-from-install/
802•psxuaw•23h ago•424 comments

Show HN: The independent guide to agent orchestrators

https://agentmgmt.dev/
3•manume•1h ago•0 comments

Show HN: Git for AI Agents

https://github.com/regent-vcs/re_gent
86•doshay•8h ago•44 comments

Podman rootless containers and the Copy Fail exploit

https://garrido.io/notes/podman-rootless-containers-copy-fail/
109•ggpsv•9h ago•21 comments

Ask HN: We just had an actual UUID v4 collision...

260•mittermayr•14h ago•224 comments