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.

Exploit brokers pay $500k for WordPress RCEs. I found one with GPT5.6 and $25

https://slcyber.io/research-center/exploit-brokers-pay-500000-for-a-wordpress-rce-i-found-one-wit...
125•infosecau•2h ago•65 comments

Show HN: I replaced a $120k bowling center system with $1,600 in ESP32s

2380•section33•20h ago•261 comments

Moonshine: Lets you stream games from your PC to any device running Moonlight

https://github.com/hgaiser/moonshine
203•wertyk•10h ago•86 comments

Sealed tomb filled with paintings and inscriptions discovered in Egypt

https://www.labrujulaverde.com/en/2026/07/sealed-tomb-of-a-high-official-or-priest-filled-with-pa...
51•isaacfrond•5d ago•38 comments

LoRA Speedrun – a public wall-clock leaderboard for fine-tuning techniques

https://github.com/Saivineeth147/lora-speedrun
89•Vineeth147•6h ago•15 comments

Claude Code uses Bun written in Rust now

https://simonwillison.net/2026/Jul/19/claude-code-in-bun-in-rust/
534•tosh•1d ago•708 comments

Eliminating Go bounds checks with unsafe

https://blog.andr2i.com/posts/2026-07-06-eliminating-go-bound-checks-with-unsafe
17•abnercoimbre•5d ago•12 comments

Self-Powered Trailers Promise Leaner Freight Runs

https://spectrum.ieee.org/self-powered-trailers-freight-decarbonization
42•rbanffy•1w ago•25 comments

Orion Browser by Kagi

https://orionbrowser.com/
214•sebjones•15h ago•152 comments

What I learned selling 2,500 MIDI recorders: Hardware is not so hard

https://chipweinberger.com/articles/20260719-hardware-is-not-so-hard
497•chipweinberger•1d ago•232 comments

Xiaomi-Robotics-1

https://robotics.xiaomi.com/xiaomi-robotics-1.html
239•ilreb•6h ago•175 comments

Minecraft: Java Edition now uses SDL3

https://www.minecraft.net/en-us/article/minecraft-26-3-snapshot-4
324•ObviouslyFlamer•23h ago•210 comments

The Zen of Parallel Programming

https://smolnero.com/posts/the-zen-of-parallel-programming
169•edgar_ortega•5d ago•23 comments

Bananas sprout in Rayleigh Garden UK after 15 years

https://www.bbc.com/news/articles/cvg8edqq5g5o
161•teleforce•21h ago•121 comments

HomeLab #1: MikroTik as a Home Router

https://justsomebody.dev/blog/mikrotik-home-router
129•rafal_opilowski•16h ago•103 comments

11,700 Free Photos from John Margolies' Archive of Americana Architecture

https://www.openculture.com/2026/07/free-photos-from-john-margolies-archive-of-americana-architec...
73•gslin•4d ago•3 comments

Qwen 3.8

https://twitter.com/Alibaba_Qwen/status/2078759124914098291
889•nh43215rgb•1d ago•619 comments

When can a power company take your land for data center infrastructure?

https://theconversation.com/when-can-a-power-company-take-your-land-for-data-center-infrastructur...
110•1vuio0pswjnm7•6h ago•82 comments

1-Bit LLM in the Browser

https://huggingface.co/spaces/webml-community/bonsai-webgpu
48•simonebrunozzi•3d ago•17 comments

Claude Fable produced a counterexample to the Jacobian Conjecture

https://xcancel.com/__alpoge__/status/2079028340955197566
436•loubbrad•8h ago•261 comments

What does the Riemann zeta function have to do with the distribution of primes?

https://hidden-phenomena.com/articles/rh
4•mb1699•2d ago•0 comments

Airbus Takes Flight from AWS

https://www.theregister.com/columnists/2026/07/20/airbus-takes-flight-from-aws-what-happens-next-...
8•bbg2401•50m ago•1 comments

I joined the IndieWeb, here's what I learned

https://en.andros.dev/blog/0b8e451e/i-joined-the-indieweb-heres-what-i-learned/
212•andros•23h ago•110 comments

How proprietary formats have become Microsoft’s main tool for lock-in

https://blog.documentfoundation.org/blog/2026/07/17/microsofts-main-tool-for-lock-in/
106•cube00•6h ago•71 comments

Who Is America's Homer?

https://www.plough.com/articles/who-is-americas-homer
86•samclemens•5d ago•176 comments

I burned all my tokens researching how to save tokens

https://quesma.com/blog/custom-deep-research-pipeline/
136•bkotrys•23h ago•186 comments

HMD Touch 4G

https://www.hmd.com/en_int/hmd-touch-4g
80•thisislife2•17h ago•88 comments

C64 Basic Dungeon Crawler: Goblin Attack (C64 Basic Part 8)

https://retrogamecoders.com/c64-basic-dungeon-part8/
76•ibobev•19h ago•6 comments

Talk: The Art of Braiding Algorithms

https://pgadey.ca/notes/talk-relatorium-2026/
44•surprisetalk•4d ago•1 comments

Dupes took over the world

https://www.vox.com/podcasts/493930/dupe-culture-fender-ugg-quince-tiktok-amazon-online-shopping
99•gumby•5d ago•92 comments