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.

GenCAD

https://gencad.github.io/
65•dagenix•2h ago•14 comments

ThinkPad: From IBM's Bento Box to Lenovo's AI Workstations

https://www.jdhodges.com/blog/thinkpad-history/
39•zdw•2h ago•13 comments

Design posters showcasing your country's electrical grid

https://github.com/open-energy-transition/grid2poster
26•lyoncy•1h ago•4 comments

Prolog Coding Horror

https://www.metalevel.at/prolog/horror
49•RohanAdwankar•3h ago•17 comments

Fabricked: Misconfiguring Infinity Fabric to Break AMD SEV-SNP

https://xca-attacks.github.io/fabricked/
16•negura•2h ago•5 comments

I turned a $80 RK3562 Android tablet into a Debian Linux workstation

https://github.com/tech4bot/rk3562deb
229•tech4bot•11h ago•117 comments

Jank now has its own custom IR

https://jank-lang.org/blog/2026-05-08-optimization/
30•DASD•2d ago•3 comments

Two EA-18 fighter jets collide at Mountain Home airshow, pilots ejected safely

https://idahonews.com/news/local/two-f-18-fighter-jets-have-crashed-during-an-airshow-at-mountain...
70•ChrisArchitect•2h ago•46 comments

Ask an Astronaut: 333 hours of Q&A footage with astronauts

https://askanastronaut.issinrealtime.org/
20•gaws•2d ago•1 comments

Mercurial, 20 years and counting: how are we still alive and kicking? [video]

https://fosdem.org/2026/schedule/event/AGWUVH-mercurial-aint-you-dead-yet/
153•ibobev•2d ago•134 comments

Magical Realism: “Northern Exposure” 25 Years Later (2015)

https://www.rogerebert.com/streaming/magical-realism-nothern-exposure-25-years-later
62•walterbell•1d ago•26 comments

VoIP brings back old-fashioned pay phones to rural Vermont (2025)

https://spectrum.ieee.org/payphone-voip
108•bookofjoe•5h ago•29 comments

Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

https://github.com/MinishLab/semble
141•Bibabomas•9h ago•37 comments

New Nightmare Just Dropped: '3D' Animated Ads on Trucks in Traffic

https://www.thedrive.com/news/new-nightmare-just-dropped-3d-animated-ads-on-trucks-in-traffic
74•cf100clunk•2d ago•34 comments

CUDA Books

https://github.com/alternbits/awesome-cuda-books
118•dariubs•11h ago•25 comments

I don't think AI will make your processes go faster

https://frederickvanbrabant.com/blog/2026-05-15-i-dont-think-ai-will-make-your-processes-go-faster/
477•TheEdonian•12h ago•343 comments

Hindenburg’s Smoking Room

https://www.airships.net/hindenburg-smoking-room/
148•crescit_eundo•3d ago•92 comments

Prolog Basics Explained with Pokémon

https://unplannedobsolescence.com/blog/prolog-basics-pokemon/
201•birdculture•2d ago•32 comments

High-Entropy Alloy

https://en.wikipedia.org/wiki/High-entropy_alloy
102•leonidasrup•3d ago•22 comments

Trials on veterans suggest ibogaine could provide a new treatment for PTSD

https://www.bbc.com/future/article/20260514-how-hallucinogenic-ibogaine-helps-veterans-overcome-ptsd
75•bushwart•12h ago•79 comments

The occasional ECONNRESET

https://movq.de/blog/postings/2026-05-05/1/POSTING-en.html
90•zdw•7h ago•20 comments

Tesla Solar Roof is on life support as it pivot to panels

https://electrek.co/2026/05/14/tesla-solar-roof-promise-vs-reality-pivot-panels/
145•celsoazevedo•20h ago•149 comments

Schanuel's Conjecture and the Semantics of Triton's FPSan

https://cp4space.hatsya.com/2026/05/03/schanuels-conjecture-and-the-semantics-of-fpsan/
19•c1ccccc1•1d ago•3 comments

Native all the way, until you need text

https://justsitandgrin.im/posts/native-all-the-way-until-you-need-text/
380•dive•12h ago•251 comments

Mozilla to UK regulators: VPNs are essential privacy and security tools

https://blog.mozilla.org/netpolicy/2026/05/15/mozilla-to-uk-regulators-vpns-are-essential-privacy...
624•WithinReason•18h ago•266 comments

Colossus: The Forbin Project

https://en.wikipedia.org/wiki/Colossus:_The_Forbin_Project
212•doener•3d ago•80 comments

AI is a technology not a product

https://daringfireball.net/2026/05/ai_is_technology_not_a_product
309•ch_sm•11h ago•125 comments

A nicer voltmeter clock

https://lcamtuf.substack.com/p/a-nicer-voltmeter-clock
309•surprisetalk•1d ago•41 comments

Apple Silicon costs more than OpenRouter

https://www.williamangel.net/blog/2026/05/17/offline-llm-energy-use.html
293•datadrivenangel•12h ago•247 comments

Multi-Species Canopy Latrines in Costa Rican Cloud Forests

https://onlinelibrary.wiley.com/doi/10.1002/ece3.72964
39•PaulHoule•3d ago•6 comments