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.

The baffling intelligence of a single cell (2024)

https://jsomers.net/e-coli-chemotaxis/
270•jsomers•1d ago•53 comments

GLM-Legal

https://z.ai/blog/glm-legal
555•ilreb•17h ago•314 comments

Document Review with Unsiloed and TypeSafe Jev

https://www.unsiloed.ai/blog/document-review-unsiloed-typesafe-jev
4•ritzaco•53m ago•0 comments

Hackers activate automatic defrosting in supermarket fridges across Europe

https://www.tomshardware.com/tech-industry/cyber-security/unprecedented-cyberattack-cripples-supe...
684•Zeekaas•21h ago•809 comments

Intel D270 GPU AI Accelerator–Up to 480 GB LPDDR5X

https://www.intel.com/content/www/us/en/products/details/discrete-gpus/data-center-gpu/d-series.html
197•hurricanepootis•11h ago•103 comments

A Modern Web App in C

https://prophitt.me/writing/a-modern-web-app-in-c
552•prophittcorey•17h ago•234 comments

DishwasherBench – Can Frontier Models Stack a Dishwasher?

https://github.com/composo-ai/DishwasherBench
6•mlukewizard•53m ago•3 comments

Who is vfmaddrnd231pd?

https://purplesyringa.moe/blog/who-is-vfmaddrnd231pd/
196•pngmangi•12h ago•20 comments

Janas: Run LLMs larger than RAM by streaming experts from SSD

https://github.com/prabanta-dev/janas
134•khalidkhair•11h ago•43 comments

Making big downloads resumable in Firefox

https://lunarwatcher.codeberg.page/til/firefox/resumable-big-downloads.html
198•speckx•13h ago•84 comments

Turn a WiFi 7 Router into a 320Msps Software Defined Radio Receiver

https://github.com/h0m3us3r/w1700k-sdr
344•djfergus•20h ago•90 comments

AI models can provably hide arbitrary capabilities

https://arxiv.org/abs/2610.13928
203•sbulaev•7h ago•104 comments

AI is a tool and using it well takes skill

https://yyhh.org/blog/2026/10/ai-is-a-tool/
404•layer8•11h ago•321 comments

Citroen revives the 2CV for an electric age

https://www.bbc.com/news/articles/c620r33plgppo
335•scrlk•21h ago•365 comments

Launch HN: Agent37 (YC F26) – Low-cost agent sandboxes for running agents

132•vishnukool•16h ago•97 comments

A look at the math that OpenAI claims computes faster Fourier transforms

https://www.argmin.net/p/faster-fourier-transforms
127•mochomocha•6h ago•95 comments

Auto Research: Integer multiplication below n log n

https://app.getsupers.com/auto-research
58•swesnow•1d ago•25 comments

Solar panels that plug into your wall

https://www.nationalgeographic.com/environment/article/balcony-plug-in-solar-panels-renewable-energy
186•speckx•18h ago•176 comments

Writing a Demoscene Intro for the ZX Spectrum

https://www.markround.com/blog/2026/zx-spectrum-intro
123•zdw•13h ago•24 comments

Show HN: SolidCraft – Open-Source Parametric CAD in Rust (With MCP Support)

https://github.com/bherbruck/solidcraft
57•bherbruck•9h ago•8 comments

Phreak.ing – Internet Phone Switch

https://phreak.ing/
128•rickcarlino•11h ago•33 comments

Show HN: An experimental pattern-first DAW that supports MCP

https://github.com/andrewfader/blokkily
55•androsynth89•9h ago•25 comments

Kevin Kelly's 2016 AI Predictions, 10 Years Later

https://taylor.town/kk-ai-2026
184•surprisetalk•18h ago•67 comments

The Making Of Super Mario 64 – full Giles Goddard interview (2001)

https://pixelatron.com/blog/the-making-of-super-mario-64-full-giles-goddard-interview-ngc/
250•gregsadetsky•2d ago•97 comments

Codex CLI installs a persistent, self-updating background daemon by default

https://github.com/openai/codex/issues/48195
558•whimblepop•14h ago•273 comments

Show HN: Brickbrag – A multiplayer brick-building world in the browser

https://brickbrag.com/
65•neuling•12h ago•38 comments

Muse Wonder

https://research.meta.ai/blog/muse-wonder
628•meetpateltech•16h ago•333 comments

Show HN: Atticus – Hold-to-talk voice assistant for macOS that runs on Claude -p

https://github.com/SaarthurR/atticus-mac
104•SaarthRanka•1d ago•19 comments

I Found a $90k Remote Code Execution Vulnerability in Google

https://simonkoeck.com/writeups/google-devsite-flask-session-pickle-rce
206•soeckly•1d ago•101 comments

Denmark set to allow return of 'physical force' in school

https://www.lemonde.fr/en/international/article/2026/10/10/denmark-set-to-allow-the-return-of-phy...
63•janisz•2h ago•41 comments