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.

Internet Archive Switzerland

https://internetarchive.ch/
345•hggh•6h ago•50 comments

CPanel's Black Week: 3 New Vulnerabilities Patched After Attack on 44k Servers

https://www.copahost.com/blog/cpanels-black-week-three-new-vulnerabilities-patched-after-ransomwa...
23•ggallas•1h ago•12 comments

PipeDream on the Acorn Archimedes

https://stonetools.ghost.io/pipedream-archimedes/
51•msephton•3h ago•15 comments

LLMs Corrupt Your Documents When You Delegate

https://arxiv.org/abs/2604.15597
226•rbanffy•9h ago•85 comments

Google broke reCAPTCHA for de-googled Android users

https://reclaimthenet.org/google-broke-recaptcha-for-de-googled-android-users
1355•anonymousiam•23h ago•491 comments

The Intolerable Hypocrisy of Cyberlibertarianism

https://matduggan.com/the-intolerable-hypocrisy-of-cyberlibertarianism/
132•ColinWright•4h ago•80 comments

How LEDs are made (2014)

https://learn.sparkfun.com/tutorials/how-leds-are-made/all
93•smig0•2d ago•12 comments

Using Claude Code: The unreasonable effectiveness of HTML

https://twitter.com/trq212/status/2052809885763747935
349•pretext•13h ago•210 comments

I Will Not Add Query Strings to Your URLs

https://susam.net/no-query-strings.html
17•susam•1h ago•0 comments

Zed Editor Theme-Builder

https://zed.dev/theme-builder
10•cuechan•48m ago•1 comments

A recent experience with ChatGPT 5.5 Pro

https://gowers.wordpress.com/2026/05/08/a-recent-experience-with-chatgpt-5-5-pro/
518•_alternator_•15h ago•375 comments

Mythical Man Month

https://martinfowler.com/bliki/MythicalManMonth.html
295•ingve•2d ago•174 comments

America's carpet capital: an empire and its toxic legacy

https://apnews.com/projects/pfas-forever-stained/
129•rawgabbit•3d ago•76 comments

OpenAI’s WebRTC problem

https://moq.dev/blog/webrtc-is-the-problem/
421•atgctg•2d ago•130 comments

GrapheneOS fixes Android VPN leak Google refused to patch

https://cyberinsider.com/grapheneos-fixes-android-vpn-leak-google-refused-to-patch/
131•Georgelemental•4h ago•37 comments

Introduction to Beaver Triples

https://stoffelmpc.com/stoffel-blog/beaver-triples-tuples
8•badcryptobitch•2h ago•3 comments

David Attenborough's 100th Birthday

https://www.bbc.com/news/articles/cp3pww9g0p5o
787•defrost•1d ago•153 comments

Reviving the IBM Selectric Composer Fonts (2023)

https://www.kutilek.de/selectric/
48•tangus•2d ago•5 comments

Building the TD4 4-Bit CPU

https://jayakody2000lk.blogspot.com/2026/05/building-td4-4-bit-cpu.html
33•zdw•2d ago•11 comments

What causes lightning? The answer keeps getting more interesting

https://www.quantamagazine.org/what-causes-lightning-the-answer-keeps-getting-more-interesting-20...
148•Tomte•3d ago•37 comments

Apple is increasing my cortisol levels

https://blog.kronis.dev/blog/apple-is-increasing-my-cortisol-levels
8•LorenDB•3h ago•0 comments

Show HN: Mochi.js: bun-native high-fidelity browser automation library

https://mochijs.com/
12•ccheshirecat•4h ago•4 comments

Show HN: I wrote a flight simulator in my own programming language

https://github.com/navid-m/flightsim
15•pizza_man•2d ago•5 comments

Killswitch: Per-function short-circuit mitigation primitive

https://lwn.net/ml/all/20260507070547.2268452-1-sashal@kernel.org/
63•signa11•9h ago•14 comments

Wi is Fi: Understanding Wi-Fi 4/5/6/6E/7/8 (802.11 n/AC/ax/be/bn)

https://www.wiisfi.com/
324•homebrewer•3d ago•88 comments

AI is breaking two vulnerability cultures

https://www.jefftk.com/p/ai-is-breaking-two-vulnerability-cultures
391•speckx•1d ago•157 comments

Show HN: Free tool to mark points and polygon regions

https://tack.pics
16•magikMaker•2d ago•3 comments

Making Julia as Fast as C++ (2019)

https://flow.byu.edu/posts/julia-c++
66•d_tr•2d ago•51 comments

Cartoon Network Flash Games

https://www.webdesignmuseum.org/flash-game-exhibitions/cartoon-network-flash-games
393•willmeyers•1d ago•120 comments

An Introduction to Meshtastic

https://meshtastic.org/docs/introduction/
482•ColinWright•1d ago•177 comments