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.

Creatine raise brain energy levels and slow Alzheimer's cognitive decline by 30%

https://thesciverse.org/scientists-found-that-the-creatine-supplement-millions-take-for-muscle-ga...
167•MrJagil•2h ago•134 comments

Cloudflare Turnstile requiring fingerprintable WebGL

https://hacktivis.me/articles/cloudflare-turnstile-webgl-fingerprinting
258•HypnoticOcelot•4h ago•147 comments

1-Bit Bonsai Image 4B Image Generation for Local Devices

https://prismml.com/news/bonsai-image-4b
122•modinfo•3h ago•40 comments

Dav2d

https://jbkempf.com/blog/2026/dav2d/
317•captain_bender•6h ago•103 comments

Restartable Sequences

https://justine.lol/rseq/
89•grappler•3h ago•17 comments

The Speed of Prototyping in the Age of AI

https://darylcecile.net/notes/speed-of-prototyping-age-of-ai
28•mooreds•1h ago•21 comments

United Airlines 767 returns to Newark after Bluetooth name sparks alert

https://simpleflying.com/united-airlines-767-returns-newark-bluetooth-name-alert/
106•Eridanus2•5h ago•108 comments

Odysseus – self-hosted AI workspace

https://github.com/pewdiepie-archdaemon/odysseus
46•Dzheky•2h ago•37 comments

London's Free Roof Terraces

https://diamondgeezer.blogspot.com/2026/05/londons-free-roof-terraces.html
217•zeristor•11h ago•115 comments

The Website Specification

https://specification.website/
360•k1m•11h ago•147 comments

Daily pill can double survival time for deadliest cancer, trial shows

https://www.theguardian.com/society/2026/may/31/daily-pill-daraxonrasib-double-survival-time-panc...
81•c-oreills•2h ago•13 comments

Deflock hits 100k ALPRs Mapped in USA

https://deflock.org/
34•pilingual•1h ago•5 comments

Having your insulin pump die while you're on vacation

https://blog.lauramichet.com/what-its-like-to-have-the-machine-that-keeps-you-alive-die-while-you...
65•speckx•2d ago•82 comments

Security Envelope Pattern collection – S.E.C.R.E.T

https://secret-archive.org/
73•ColinWright•2d ago•8 comments

Backpressure is all you need

https://www.lucasfcosta.com/blog/backpressure-is-all-you-need
66•lucasfcosta•6h ago•58 comments

I put a datacenter GPU in my gaming PC

https://blog.tymscar.com/posts/v100localllm/
170•birdculture•4h ago•117 comments

You weren't meant to have a boss (2008)

https://paulgraham.com/boss.html
69•downbad_•5h ago•62 comments

Shantell Sans (2023)

https://shantellsans.com/process
362•aleda145•20h ago•43 comments

Websites have a new way to spy on visitors: analyzing their SSD activity

https://arstechnica.com/security/2026/05/websites-have-a-new-way-to-spy-on-visitors-analyzing-the...
18•Brajeshwar•3d ago•4 comments

Avoiding Death on the Yellow Brick Road

https://www.a16z.news/p/avoiding-death-on-the-yellow-brick
11•ex-aws-dude•2d ago•1 comments

The AV2 Video Standard Has Released (Final v1.0 Specification)

https://av2.aomedia.org
312•ksec•20h ago•139 comments

One year of Roto, a compiled scripting language for Rust

https://blog.nlnetlabs.nl/one-year-of-roto-the-compiled-scripting-language-for-rust/
99•Hasnep•2d ago•25 comments

FROST: Fingerprinting Remotely using OPFS-based SSD Timing [pdf]

https://hannesweissteiner.com/pdfs/frost.pdf
16•simjnd•4h ago•7 comments

I found a seashell in the middle of the desert

https://github.com/Hawzen/I-found-a-seashell-in-the-middle-of-the-desert#i-found-a-seashell-in-th...
401•Hawzen•2d ago•105 comments

A Gentle Introduction to Lattice-Based Cryptography [pdf]

https://cryptography101.ca/wp-content/uploads/lattice-based-cryptography.pdf
145•jayhoon•2d ago•14 comments

Show HN: Atomic Editor – Obsidian-style live preview for CodeMirror 6

https://kenforthewin.github.io/atomic-editor/
30•kenforthewin•5h ago•7 comments

Chibil: A C compiler targeting .NET IL

https://github.com/MichalStrehovsky/chibil
31•algorithmsRcool•2h ago•4 comments

Telli (YC F24) is hiring in engineering, design, and GTM [Berlin, on-site]

https://hi.telli.com/join-us
1•sebselassie•11h ago

Avian Visitors

https://theodore.net/projects/AvianVisitors/
101•fdb•12h ago•11 comments

Inkstravaganza

https://www.inkandswitch.com/newsletter/dispatch-015/
23•surprisetalk•3d ago•4 comments