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•9mo ago

Comments

quentinp•9mo 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•9mo ago
Page didnt load for me.

https://realpython.com/async-io-python/

Multiprocessing all the way!

emmelaich•9mo ago
(2021)

Good article!

punnerud•9mo 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•9mo 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•9mo ago
How does the GIL come into play here?
punnerud•9mo 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.

LT6502: A 6502-based homebrew laptop

https://github.com/TechPaula/LT6502
81•classichasclass•1h ago•9 comments

I Fixed Windows Native Development

https://marler8997.github.io/blog/fixed-windows/
428•deevus•6h ago•222 comments

EU bans the destruction of unsold apparel, clothing, accessories and footwear

https://environment.ec.europa.eu/news/new-eu-rules-stop-destruction-unsold-clothes-and-shoes-2026...
186•giuliomagnifico•1h ago•127 comments

Gwtar: A static efficient single-file HTML format

https://gwern.net/gwtar
42•theblazehen•2h ago•7 comments

Hideki Sato, designer of all Sega's consoles, has died

https://www.videogameschronicle.com/news/hideki-sato-designer-of-segas-consoles-dies-age-75/
138•magoghm•2h ago•4 comments

Palantir Gets Millions of Dollars from New York City's Public Hospitals

https://theintercept.com/2026/02/15/palantir-contract-new-york-city-health-hospitals/
44•cdrnsf•46m ago•5 comments

I love the work of the ArchWiki maintainers

https://k7r.eu/i-love-the-work-of-the-archwiki-maintainers/
785•panic•17h ago•137 comments

Palantir vs. the "Republik": US analytics firm takes magazine to court

https://www.heise.de/en/news/Palantir-vs-the-Republik-US-analytics-firm-takes-magazine-to-court-1...
65•cdrnsf•1h ago•11 comments

An Enslaved Gardener Transformed the Pecan into a Cash Crop

https://lithub.com/how-an-enslaved-gardener-transformed-the-pecan-into-a-cash-crop/
43•PaulHoule•2h ago•29 comments

Flashpoint Archive – Over 200k web games and animations preserved

https://flashpointarchive.org
267•helloplanets•12h ago•62 comments

Real-time PathTracing with global illumination in WebGL

https://erichlof.github.io/THREE.js-PathTracing-Renderer/
19•tobr•2d ago•2 comments

Reversed engineered game Starflight (1986)

https://github.com/s-macke/starflight-reverse
66•tosh•6h ago•36 comments

Oat – Ultra-lightweight, semantic, zero-dependency HTML UI component library

https://oat.ink/
307•twapi•10h ago•88 comments

How Is Data Stored?

https://www.makingsoftware.com/chapters/how-is-data-stored
75•tzury•5d ago•5 comments

Amazon, Google Unwittingly Reveal the Severity of the U.S. Surveillance State

https://greenwald.substack.com/p/amazons-ring-and-googles-nest-unwittingly
445•mikece•5h ago•288 comments

RynnBrain

https://github.com/alibaba-damo-academy/RynnBrain
49•jsemrau•4d ago•1 comments

1940s Irish sci-fi novel features early mecha and gravity assists

https://github.com/cavedave/Manannan
16•donohoe•3h ago•3 comments

My smart sleep mask broadcasts users' brainwaves to an open MQTT broker

https://aimilios.bearblog.dev/reverse-engineering-sleep-mask/
557•minimalthinker•1d ago•235 comments

The seam through the center of things

https://usefulfictions.substack.com/p/the-seam-through-the-center-of-things
23•surprisetalk•2d ago•4 comments

Build Gaussian Splat Experiences with SuperSplat Studio

https://blog.playcanvas.com/build-gaussian-splat-experiences-with-supersplat-studio/
18•ovenchips•4d ago•3 comments

Two different tricks for fast LLM inference

https://www.seangoedecke.com/fast-llm-inference/
130•swah•8h ago•60 comments

A practical guide to observing the night sky for real skies and real equipment

https://stargazingbuddy.com/
100•constantinum•3d ago•17 comments

Constraint Propagation for Fun

https://eli.li/constraint-propagation-for-fun
39•rickcarlino•5d ago•0 comments

Zvec: A lightweight, fast, in-process vector database

https://github.com/alibaba/zvec
199•dvrp•2d ago•35 comments

Interference Pattern Formed in a Finger Gap Is Not Single Slit Diffraction

https://note.com/hydraenids/n/nbe89030deaba
81•uolmir•2d ago•10 comments

Instagram's URL Blackhole

https://medium.com/@shredlife/instagrams-url-blackhole-c1733e081664
280•tkp-415•2d ago•44 comments

DjVu and its connection to Deep Learning (2023)

https://scottlocklin.wordpress.com/2023/05/31/djvu-and-its-connection-to-deep-learning/
54•tosh•9h ago•7 comments

Inner-Platform Effect

https://en.wikipedia.org/wiki/Inner-platform_effect
31•tosh•3h ago•6 comments

uBlock filter list to hide all YouTube Shorts

https://github.com/i5heu/ublock-hide-yt-shorts/
1065•i5heu•1d ago•314 comments

Show HN: Copy-and-patch compiler for hard real-time Python

https://github.com/Nonannet/copapy
49•Saloc•4d ago•2 comments