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

Comments

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

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

Multiprocessing all the way!

emmelaich•10mo ago
(2021)

Good article!

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

The curious case of retro demo scene graphics

https://www.datagubbe.se/aipixels/
57•zdw•1h ago•8 comments

ChatGPT won't let you type until Cloudflare reads your React state

https://www.buchodi.com/chatgpt-wont-let-you-type-until-cloudflare-reads-your-react-state-i-decry...
525•alberto-m•10h ago•352 comments

Copilot edited an ad into my PR

https://notes.zachmanson.com/copilot-edited-an-ad-into-my-pr/
313•pavo-etc•3h ago•94 comments

VHDL's Crown Jewel

https://www.sigasi.com/opinion/jan/vhdls-crown-jewel/
24•cokernel_hacker•2h ago•9 comments

Voyager 1 runs on 69 KB of memory and an 8-track tape recorder

https://techfixated.com/a-1977-time-capsule-voyager-1-runs-on-69-kb-of-memory-and-an-8-track-tape...
492•speckx•14h ago•185 comments

15 Years of Forking

https://www.waterfox.com/blog/15-years-of-forking/
135•MrAlex94•2d ago•14 comments

Coding Agents Could Make Free Software Matter Again

https://www.gjlondon.com/blog/ai-agents-could-make-free-software-matter-again/
152•rogueleaderr•8h ago•132 comments

Philly courts will ban all smart eyeglasses starting next week

https://www.inquirer.com/news/philadelphia/smart-glasses-ai-meta-courts-20260326.html
199•Philadelphia•5h ago•71 comments

C++26 is done ISO C++ standards meeting, Trip Report

https://herbsutter.com/2026/03/29/c26-is-done-trip-report-march-2026-iso-c-standards-meeting-lond...
209•pjmlp•13h ago•170 comments

15 years, one server, 8GB RAM and 500k users – how Webminal refuses to die

https://community.webminal.org/t/15-years-one-server-8gb-ram-and-500k-users-how-webminal-refuses-...
27•giis•57m ago•4 comments

Hardware Image Compression

https://www.ludicon.com/castano/blog/2026/03/hardware-image-compression/
14•luu•1d ago•2 comments

HD Audio Driver for Windows 98SE / Me

https://github.com/andrew-hoffman/wdmhda
26•userbinator•2h ago•3 comments

Gonon: Building a Clock with No Numerals

https://tonygaeta.com/perceptor/code/gonon
20•nullpath•3d ago•13 comments

Pretext: TypeScript library for multiline text measurement and layout

https://github.com/chenglou/pretext
280•emersonmacro•1d ago•48 comments

Midnight train from GA: A view of America from the tracks as airports struggle

https://apnews.com/article/airports-shutdown-long-lines-train-travel-amtrak-e4d8ea591b3b036142c2b...
84•walterbell•11h ago•72 comments

Douglas Lenat's Automated Mathematician Source Code

https://github.com/white-flame/am
7•hydrolox•4d ago•0 comments

The Cognitive Dark Forest

https://ryelang.org/blog/posts/cognitive-dark-forest/
392•kaycebasques•11h ago•180 comments

Eclipse GlassFish: This Isn't Your Father's GlassFish

https://foojay.io/today/eclipse-glassfish-this-isnt-your-fathers-glassfish/
9•henk53•4d ago•1 comments

"Roadrunner": a bipedal, wheeled robot for multi-modal locomotion [video]

https://www.youtube.com/watch?v=9kae-UAME1U
20•surprisetalk•4d ago•7 comments

Claude Code runs Git reset –hard origin/main against project repo every 10 mins

https://github.com/anthropics/claude-code/issues/40710
228•mthwsjc_•8h ago•157 comments

AI and bots have officially taken over the internet

https://www.cnbc.com/2026/03/26/ai-bots-humans-internet.html
8•zaikunzhang•36m ago•3 comments

Interview: Nobonoko, Master of the Minimal Sequencer

https://fi-le.net/nobo/
23•fi-le•2d ago•2 comments

My MacBook keyboard is broken and it's insanely expensive to fix

https://tobiasberg.net/posts/my-macbook-keyboard-is-broken-and-its-insanely-expensive-to-fix/
147•TobiasBerg•11h ago•172 comments

About the Atmosphere

https://toni.org/2026/03/27/about-the-atmosphere/
48•Kye•2d ago•8 comments

The road signs that teach travellers about France

https://www.bbc.com/travel/article/20260327-the-road-signs-that-teach-travellers-about-france
83•1659447091•10h ago•38 comments

LinkedIn uses 2.4 GB RAM across two tabs

703•hrncode•22h ago•400 comments

New Apple Silicon M4 and M5 HiDPI Limitation on 4K External Displays

https://smcleod.net/2026/03/new-apple-silicon-m4-m5-hidpi-limitation-on-4k-external-displays/
234•smcleod•5h ago•109 comments

Kyushu Railway Company Train Varieties

https://www.jrkyushu.co.jp/english/train/index.html
80•NaOH•11h ago•11 comments

The RISE RISC-V Runners: free, native RISC-V CI on GitHub

https://riseproject.dev/2026/03/24/announcing-the-rise-risc-v-runners-free-native-risc-v-ci-on-gi...
130•thebeardisred•3d ago•34 comments

Moretti replication published in AER

https://blog.michaelwiebe.com/p/moretti-replication-published-in
7•luu•1d ago•0 comments