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.

It took a year to ship WebAssembly in Anubis

https://anubis.techaro.lol/blog/2026/anubis-wasm/
55•xena•1h ago•31 comments

Show HN: Mador – Make any DOM reactive with a tiny 80-line Proxy state tuple

https://github.com/marsbos/mador
33•bosmarcel•1h ago•11 comments

Your intellectual fly is open (2025)

https://bcantrill.dtrace.org/2025/12/05/your-intellectual-fly-is-open/
435•cyb0rg0•9h ago•281 comments

GrapheneOS Overhauled Default Apps and Secure Clipboard

https://grapheneos.social/@GrapheneOS/117225539756835649
44•Cider9986•1h ago•15 comments

Isar Aerospace reaches orbit and deploys payloads on second flight

https://isaraerospace.com/press/history-for-european-spaceflight-isar-aerospace-reaches-orbit-and...
515•mpweiher•14h ago•166 comments

NetBSD 9.5 released and EOL for NetBSD-9

https://blog.netbsd.org/tnf/entry/netbsd_9_5_released_and
94•jaypatelani•6h ago•4 comments

Show HN: VODForge – a free local desktop UI for YouTube video/playlist downloads

https://getvodforge.com/
16•coopernusbaum•1h ago•1 comments

Black Hole of Los Alamos Seller of surplus nuclear research materials

https://www.atlasobscura.com/places/black-hole-of-los-alamos
16•Bluestein•4d ago•3 comments

Babylonian Lamb Stew with Beets (1750–1730 BCE)

https://babylonian-collection.yale.edu/about/babylonian-cooking
59•yubblegum•3d ago•24 comments

Research carried out using NetBSD

https://www.netbsd.org/gallery/research.html
64•Bluestein•5h ago•14 comments

An Alien Mind

https://openai.com/index/an-alien-mind/
264•tosh•5h ago•204 comments

Asahi Linux on M3

https://asahilinux.org/2026/09/m2-episode-1/
261•mdp2021•7h ago•153 comments

A/I shuts down – Stay human

https://keepitfree.ai/announcements/a/i-shuts-down-stay-human/
449•captainmuon•7h ago•300 comments

Electronic skin for prosthetics to sense temperature and pressure

https://news.wsu.edu/press-release/2026/08/20/researchers-develop-electronic-skin-for-prosthetics...
34•gmays•4d ago•5 comments

Vidact – a compiler that turns React into direct DOM operations

https://www.vidact.dev/
38•mohebifar•4d ago•18 comments

Opalite Health (YC W26) Is Hiring – Founding GTM

https://www.ycombinator.com/companies/opalite-health/jobs/bNedVAD-founding-gtm
1•ckuo9•4h ago

Harnessing the Universal Geometry of Embeddings

https://arxiv.org/abs/2505.12540
6•ur-whale•1h ago•0 comments

Doomscrolling Ourselves to Death

https://www.edwest.co.uk/p/doomscrolling-ourselves-to-death
328•shubhamjain•9h ago•226 comments

Human archive: They were only human

https://sayyss.github.io/human-archive/
8•jonwinstanley•1h ago•3 comments

Reverse engineering the storage format for an undocumented database

https://blog.glazer.ee/posts/converting-cronos/
3•pintprint•2d ago•0 comments

M-DISC – DVD/Blu-ray compatible discs that may last up to 1000 years

https://en.wikipedia.org/wiki/M-DISC
167•gurjeet•4d ago•77 comments

Research acceleration: The view inside OpenAI

https://openai.com/index/research-acceleration-view-inside-openai
84•iamsyr•6h ago•56 comments

The revolt of the reader

https://bcantrill.dtrace.org/2026/09/05/the-revolt-of-the-reader/
554•chmaynard•1d ago•269 comments

Cloud in a Bottle: making self-hosting accessible to everyone

https://cloudinabottle.org/blog/launch-post
597•zplizzi•21h ago•294 comments

The car industry A/B tested selling a car with and without CarPlay

https://a.wholelottanothing.org/the-car-industry-a-b-tested-selling-the-same-car-with-and-without...
78•gumby•1h ago•64 comments

Nitter and XCancel resume service after legal advice

https://github.com/zedeus/nitter/commit/1428b4c2b4246f92a7e5b2673438e5fb39fcc4a3
327•zImPatrick•4h ago•196 comments

Is There I/O After Death? What Happens to Io_uring When a Process Dies

https://blog.ydb.tech/is-there-i-o-after-death-what-happens-to-io-uring-when-a-process-dies-92c65...
55•porridgeraisin•4d ago•26 comments

Windows 11's "special" developer edition looks like another marketing misfire

https://www.neowin.net/opinions/windows-11s-special-developer-edition-sounds-like-yet-another-mar...
10•bundie•34m ago•0 comments

IBM Quantum Nighthawk R2

https://www.ibm.com/quantum/blog/nighthawk-r2
77•fuglede_•3d ago•35 comments

Music Theory for Programmers

https://runjs.app/blog/music-theory-for-programmers
342•birdculture•4d ago•219 comments