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.

Introducing System One Models and Jev

https://typesafe.ai/blog/introducing-system-one-models-and-jev
739•albelfio•6h ago•250 comments

Show HN: An e-ink frame that hears birds and draws them as 1800s illustrations

https://github.com/arnegiacomo/fugleramme
1297•arnemunthekaas•12h ago•181 comments

An Update on Wayback Machine Access

https://blog.archive.org/2026/09/15/an-update-on-wayback-machine-access/
379•ChrisArchitect•7h ago•209 comments

German Rheinmetall open-sources its Battlesuite connected weapon system protcol

https://rheinmetall.github.io/onboardapi-documentation/9.10.0/index.html
125•summarity•4h ago•40 comments

Gemini 3.8 Live and 3.8 Live Extended Thinking

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-8-live-gemini-3-...
297•leumon•7h ago•187 comments

Jean-Pierre Serre is 100 years old today

https://mathshistory.st-andrews.ac.uk/Biographies/Serre/
85•jzox•4h ago•13 comments

Building a Linux GPU Driver for the M4 Mac Mini in One Month

https://codyho.dev/blog/gpu-driver/
153•ADevWithAnIdea•5h ago•91 comments

We got admin access to Baseten's production GitHub in 25 minutes

https://www.strix.ai/blog/baseten-harbor-github-pat-takeover
212•bearsyankees•7h ago•113 comments

Sierra digital cameras on the Apple II

https://www.colino.net/wordpress/archives/2026/09/11/sierra-digital-cameras-on-the-apple-ii/
17•ibobev•2d ago•0 comments

Chopping up books when they're physically too big

https://attainablefelicity.mattkirkland.com/20260915/cut-up-your-books.html
119•matt_kirkland•6h ago•116 comments

Recreating Voodoo Graphics and a Late-1990s Gaming PC on an FPGA

https://nand2mario.github.io/posts/2026/zsst-voodoo/
15•zdw•2h ago•1 comments

Learning to solve hard problems in RL for LLMs by never giving up

https://mnoukhov.github.io/posts/ngu/
34•natolambert•6h ago•0 comments

Saving Jet Fuel

https://tech.marksblogg.com/scikit-decide-openap-optimal-flight-planning.html
25•marklit•2h ago•13 comments

WangNet – 1.8 MB, zero-dependency Numberwang adjudication in 11 languages

https://github.com/GraafHenk/numberwang
105•Liogra123•6h ago•42 comments

Show HN: Capsule – Single-file web apps that save their data into SQLite

https://withcapsule.app/
280•bashtian•11h ago•118 comments

Why I'm still bearish on LLMs after Navier-Stokes

https://dank.systems/posts/2026-09-15-ai-bear.html
139•jaykru•7h ago•104 comments

Let's make quality the norm again

https://www.forbrukerradet.no/short-life/
304•ingve•15h ago•314 comments

The Beauty of Roundabouts

https://gruhn.me/blog/2026-09-14/
5•ngruhn•1d ago•5 comments

Show HN: Pizza Bot – An inbox for AI agents that work in the background

https://github.com/pizza-bot-app/pizza-bot
31•jd_•10h ago•13 comments

Suspected sabotage causes major Netherlands rail disruption

https://www.bbc.com/news/articles/c8ly49w9g1edo
432•choult•15h ago•395 comments

A single firm is behind OpenAI, Anthropic, and Meta hacking scandals

https://www.effort.news/irregular
452•yusufozkan•1d ago•159 comments

Data races and the limits of ThreadSanitizer in C and Go

https://theconsensus.dev/p/2026/09/06/data-races-and-the-limits-of-threadsanitizer-in-c-and-go.html
27•matt_d•2d ago•2 comments

Jiga (YC W21) Is Hiring Product Engineer (Remote/US)

https://jiga.io/about-us/?ashby_jid=0b75d72d-c92b-4dca-8062-09d298ada0bd
1•grmmph•8h ago

Show HN: Hacking a $20 4G wireless hotspot into a texting device

https://bkovac.github.io/modem-thing/
175•bobili1234•12h ago•31 comments

US confirms for first time it has deployed space weapons

https://www.bbc.com/news/articles/ck790xg41ygro
443•harporoeder•21h ago•314 comments

Most people prefer traditional architecture

https://www.worksinprogress.news/p/do-people-prefer-traditional-architecture
262•alihm•1d ago•214 comments

GEFS on OpenBSD: A Early Preview

https://marc.info/?l=openbsd-tech&m=178948744271633&w=2
108•sippingabonedry•8h ago•60 comments

Cartesian – AI 3D Modeling for Design

https://www.formas.ai/cartesian
90•eustoria•10h ago•76 comments

The CSS Zen Garden dream, finally shipped

https://josprague.com/blog/the-css-zen-garden-dream-finally-shipped/
126•yosito•10h ago•68 comments

The Inference Hardware Revolution of 2026

https://spectrum.ieee.org/inference-hardware-revolution
108•vinhnx•11h ago•9 comments