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.

Dav2d

https://code.videolan.org/videolan/dav2d
169•dabinat•3h ago•69 comments

I Do Not Recommend Bitwarden

https://xn--gckvb8fzb.com/i-do-not-recommend-bitwarden/
19•maxloh•30m ago•7 comments

Inventions for battery reuse and recycling increase seven-fold in last decade

https://www.epo.org/en/news-events/news/inventions-battery-reuse-and-recycling-increase-more-seve...
111•JeanKage•2d ago•4 comments

Do_not_track

https://donottrack.sh/
67•RubyGuy•2h ago•33 comments

NetHack 5.0.0

https://nethack.org/v500/release.html
250•rsaarelm•2h ago•53 comments

Unsigned Sizes: A Five Year Mistake

https://c3-lang.org/blog/unsigned-sizes-a-five-year-mistake/
37•lerno•1h ago•35 comments

Flue is a TypeScript framework for building the next generation of agents

https://flueframework.com/
51•momentmaker•3h ago•19 comments

California to begin ticketing driverless cars that violate traffic laws

https://www.bbc.com/news/articles/clypjx3rg2go
124•geox•2h ago•136 comments

Little Magazines Are Back

https://wsjfreeexpression.substack.com/p/little-magazines-are-back
23•prismatic•2d ago•2 comments

Why does it take so long to release black fan versions?

https://www.noctua.at/en/expertise/blog/how-can-it-take-so-long-to-release-black-fan-versions
646•buildbot•15h ago•271 comments

How fast is a macOS VM, and how small could it be?

https://eclecticlight.co/2026/05/02/how-fast-is-a-macos-vm-and-how-small-could-it-be/
203•moosia•11h ago•77 comments

Barman – Backup and Recovery Manager for PostgreSQL

https://github.com/EnterpriseDB/barman
117•nateb2022•3d ago•22 comments

Roblox shares plummet 18% as child safety measures weigh on bookings

https://www.cnbc.com/2026/05/01/roblox-rblx-stock-child-safety-earnings.html
115•1vuio0pswjnm7•3h ago•65 comments

Welcome to Hell Developer

https://noahclements.com/Wahoo-Bolt-Hidden-Debug-Mode/
24•denysvitali•3h ago•3 comments

Uber wants to turn its drivers into a sensor grid for self-driving companies

https://techcrunch.com/2026/05/01/uber-wants-to-turn-its-millions-of-drivers-into-a-sensor-grid-f...
96•nickvec•4h ago•111 comments

Refusal in Language Models Is Mediated by a Single Direction

https://arxiv.org/abs/2406.11717
69•fagnerbrack•7h ago•23 comments

The USB Situation

https://randsinrepose.com/archives/the-usb-situation/
58•herbertl•3d ago•66 comments

Why IPv6 is so complicated

https://github.com/becarpenter/book6/blob/main/01.%20Introduction%20and%20Foreword/Why%20IPv6%20i...
57•speckx•3d ago•108 comments

Why are there both TMP and TEMP environment variables? (2015)

https://devblogs.microsoft.com/oldnewthing/20150417-00/?p=44213
177•ankitg12•12h ago•81 comments

Open Design: Use Your Coding Agent as a Design Engine

https://github.com/nexu-io/open-design
145•steveharing1•8h ago•77 comments

Dotcl: Common Lisp Implementation on .NET

https://github.com/dotcl/dotcl
136•reikonomusha•2d ago•30 comments

Canonical Under Attack

https://status.canonical.com
25•ta988•1h ago•2 comments

Ti-84 Evo

https://education.ti.com/en/products/calculators/graphing-calculators/ti-84-evo
561•thatxliner•1d ago•454 comments

Show HN: Pollen – distributed WASM runtime, no control plane, single binary

https://github.com/sambigeara/pollen
90•sambigeara•2d ago•41 comments

America's Expanding Domestic Surveillance

https://www.wsj.com/articles/americas-expanding-domestic-surveillance-08b73187
149•Brajeshwar•5h ago•91 comments

Show HN: DAC – open-source dashboard as code tool for agents and humans

https://github.com/bruin-data/dac
85•karakanb•3d ago•29 comments

Artemis II Photo Timeline

https://artemistimeline.com/#artemis-ii-walkout-nhq202604010003
330•geerlingguy•2d ago•26 comments

DeepSeek V4—almost on the frontier

https://simonwillison.net/2026/Apr/24/deepseek-v4/
437•indigodaddy•1d ago•281 comments

New research suggests people can communicate and practice skills while dreaming

https://www.newyorker.com/culture/annals-of-inquiry/its-possible-to-learn-in-our-sleep-should-we
430•XzetaU8•1d ago•253 comments

Zugzwang

https://en.wikipedia.org/wiki/Zugzwang
84•Qem•4h ago•52 comments