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

Comments

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

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

Multiprocessing all the way!

emmelaich•11mo ago
(2021)

Good article!

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

Taking on CUDA with ROCm: 'One Step After Another'

https://www.eetimes.com/taking-on-cuda-with-rocm-one-step-after-another/
29•mindcrime•2h ago•27 comments

Bring Back Idiomatic Design

https://essays.johnloeber.com/p/4-bring-back-idiomatic-design
442•phil294•12h ago•222 comments

DIY Soft Drinks

https://blinry.org/diy-soft-drinks/
228•_Microft•8h ago•52 comments

Ask HN: What Are You Working On? (April 2026)

114•david927•8h ago•299 comments

A Perfectable Programming Language

https://alok.github.io/lean-pages/perfectable-lean/
41•yuppiemephisto•3h ago•6 comments

Most people can't juggle one ball

https://www.lesswrong.com/posts/jTGbKKGqs5EdyYoRc/most-people-can-t-juggle-one-ball
216•surprisetalk•3d ago•78 comments

I gave every train in New York an instrument

https://www.trainjazz.com/
194•joshuawolk•2d ago•37 comments

Google removes "Doki Doki Literature Club" from Google Play

https://bsky.app/profile/serenityforge.com/post/3mj3r4nbiws2t
261•super256•4h ago•116 comments

The peril of laziness lost

https://bcantrill.dtrace.org/2026/04/12/the-peril-of-laziness-lost/
287•gpm•4h ago•99 comments

Show HN: Oberon System 3 runs natively on Raspberry Pi 3 (with ready SD card)

https://github.com/rochus-keller/OberonSystem3Native/releases
161•Rochus•11h ago•36 comments

Show HN: Claudraband – Claude Code for the Power User

https://github.com/halfwhey/claudraband
87•halfwhey•7h ago•26 comments

Show HN: boringBar – a taskbar-style dock replacement for macOS

https://boringbar.app/
212•a-ve•7h ago•132 comments

Tech valuations are back to pre-AI boom levels

https://www.apollo.com/wealth/the-daily-spark/tech-valuations-back-to-pre-ai-boom-levels
91•akyuu•2h ago•13 comments

Uncharted island soon to appear on nautical charts

https://www.awi.de/en/about-us/service/press/single-view/unkartierte-insel-demnaechst-auf-seekart...
33•tannhaeuser•4h ago•10 comments

Tell HN: docker pull fails in spain due to football cloudflare block

645•littlecranky67•12h ago•251 comments

Anthropic downgraded cache TTL on March 6th

https://github.com/anthropics/claude-code/issues/46829
465•lsdmtme•18h ago•359 comments

Seven countries now generate 100% of their electricity from renewable energy

https://www.the-independent.com/tech/renewable-energy-solar-nepal-bhutan-iceland-b2533699.html
477•mpweiher•11h ago•234 comments

Investigating How Long-Distance Couples Use Digital Games to Facilitate Intimacy

https://arxiv.org/abs/2505.09509
57•radeeyate•8h ago•13 comments

JVM Options Explorer

https://chriswhocodes.com/vm-options-explorer.html
169•0x54MUR41•14h ago•72 comments

Happy Map

https://pudding.cool/2026/02/happy-map/
209•surprisetalk•5d ago•32 comments

EasyPost (YC S13) Is Hiring

https://www.easypost.com/careers
1•jstreebin•7h ago

Phyphox – Physical Experiments Using a Smartphone

https://phyphox.org/
183•_Microft•16h ago•30 comments

Mark's Magic Multiply

https://wren.wtf/shower-thoughts/marks-magic-multiply/
32•luu•1d ago•2 comments

Exploiting the most prominent AI agent benchmarks

https://rdi.berkeley.edu/blog/trustworthy-benchmarks-cont/
489•Anon84•1d ago•125 comments

Cooperative Vectors Introduction

https://www.evolvebenchmark.com/blog-posts/cooperative-vectors-introduction
44•JasperBekkers•2d ago•2 comments

A Tour of Oodi

https://blinry.org/oodi/
107•zdw•3d ago•35 comments

Doom, Played over Curl

https://github.com/xsawyerx/curl-doom
97•creaktive•14h ago•18 comments

European AI. A playbook to own it

https://europe.mistral.ai/
137•hjouneau•4h ago•78 comments

Textbooks and Methods of Note-Taking in Early Modern Europe (2008)

https://dash.harvard.edu/server/api/core/bitstreams/7312037d-e342-6bd4-e053-0100007fdf3b/content
24•mooreds•8h ago•0 comments

The Physics of GPS

https://perthirtysix.com/how-does-gps-work
113•maouida•13h ago•30 comments