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.

Project Gutenberg – keeps getting better

https://www.gutenberg.org/
277•JSeiko•2h ago•91 comments

A 0-click exploit chain for the Pixel 10

https://projectzero.google/2026/05/pixel-10-exploit.html
217•happyhardcore•4h ago•89 comments

I designed a nibble-oriented CPU in Verilog to build a scientific calculator

https://github.com/gdevic/FPGA-Calculator
23•gdevic•1h ago•2 comments

Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

https://github.com/oven-sh/bun/issues/30719
33•ndiddy•1h ago•0 comments

Image-blaster: Creates 3D environments, SFX, and meshes from a single image

https://github.com/neilsonnn/image-blaster
42•MattRogish•2h ago•7 comments

O(x)Caml in Space

https://gazagnaire.org/blog/2026-05-14-borealis.html
197•yminsky•7h ago•43 comments

ASCII by Jason Scott

https://ascii.textfiles.com/
90•bookofjoe•4h ago•16 comments

U.S. DOJ demands Apple and Google unmask over 100k users of car-tinkering app

https://macdailynews.com/2026/05/15/u-s-doj-demands-apple-and-google-unmask-over-100000-users-of-...
65•tencentshill•55m ago•23 comments

Hightouch (YC S19) Is Hiring

https://hightouch.com/careers
1•joshwget•1h ago

Explore Wikipedia Like a Windows XP Desktop

https://explorer.samismith.com/
397•smusamashah•9h ago•102 comments

I built Zenith: a live local-first fixed viewport planetarium

https://smorgasb.org/zenith-tech/
37•surprisetalk•2h ago•4 comments

Show HN: Watch a neural net learn to play Snake

https://ppo.gradexp.xyz/
48•c1b•1d ago•10 comments

Aperio Lang

https://aperio-lang.github.io/aperio/introduction.html
18•mmcclure•1h ago•4 comments

High dimensional geometry is transforming the MRI industry (2017) [pdf]

https://www.ams.org/government/DonohoPresentation06-28-17Final.pdf
60•nill0•4h ago•18 comments

Radicle: Sovereign {code forge} built on Git

https://radicle.dev/
161•KolmogorovComp•6h ago•41 comments

A new book on Steve Jobs at NeXT

https://spectrum.ieee.org/steve-jobs-next-computer
125•rbanffy•7h ago•107 comments

Feedr v0.8.0 – a TUI RSS reader, now read the full article from your terminal

https://github.com/bahdotsh/feedr
4•bahdotshxx•1h ago•2 comments

Removing the modem and GPS from my 2024 RAV4 hybrid

https://arkadiyt.com/2026/05/13/removing-the-modem-and-gps-from-my-rav4/
1020•arkadiyt•1d ago•537 comments

Amazon workers under pressure to up their AI usage are making up tasks

https://www.fastcompany.com/91541586/amazon-workers-pressured-to-up-ai-use-extraneous-tasks
213•hackernj•4h ago•209 comments

Show HN: Sx – an open-source package manager for AI skills, MCPs, and commands

https://github.com/sleuth-io/sx
8•detkin•1h ago•1 comments

Show HN: Find local farms near you with raw dairy, pasture eggs, and more

https://farm-to-door.com/
11•YoungGato•1h ago•4 comments

Trade Dollars with other startups. Book it as revenue

https://www.revswap.ai/
158•tormeh•5h ago•113 comments

A few words on DS4

https://antirez.com/news/165
398•caust1c•19h ago•165 comments

We don't know why Malawi is poor

https://newsletter.deenamousa.com/p/we-dont-know-why-malawi-is-poor
48•alphabetatango•1h ago•53 comments

NanoTDB – Golang Append-Only Time Series DB

https://github.com/aymanhs/nanotdb
43•aymanhs72•7h ago•6 comments

Details of the Daring Airdrop at Tristan Da Cunha

https://www.tristandc.com/government/news-2026-05-11-airdrop.php
231•kspacewalk2•14h ago•88 comments

Ask HN: How to be SOC2 Type 2 compliant as a solo-entreprenuer?

85•sochix•11h ago•79 comments

RTX 5090 and M4 MacBook Air: Can It Game?

https://scottjg.com/posts/2026-05-05-egpu-mac-gaming/
671•allenleee•1d ago•159 comments

Building ML framework with Rust and Category Theory

https://hghalebi.github.io/category_theory_transformer_rs/
85•adamnemecek•1d ago•19 comments

First public macOS kernel memory corruption exploit on Apple M5

https://blog.calif.io/p/first-public-kernel-memory-corruption
422•quadrige•23h ago•114 comments