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

Comments

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

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

Multiprocessing all the way!

emmelaich•6mo ago
(2021)

Good article!

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

Bazzite: The next generation of Linux gaming

https://bazzite.gg/
76•doener•2h ago•21 comments

Landlock-Ing Linux

https://blog.prizrak.me/post/landlock/
87•razighter777•2h ago•24 comments

Dilution vs. Risk taking: Capital gains taxes and entrepreneurs

https://www.nber.org/papers/w34512
16•hhs•29m ago•2 comments

All it takes is for one to work out

https://alearningaday.blog/2025/11/28/all-it-takes-is-for-one-to-work-out-2/
257•herbertl•4h ago•142 comments

Be Like Clippy

https://be-clippy.com/
187•Aloha•4h ago•125 comments

Learning Feynman's Trick for Integrals

https://zackyzz.github.io/feynman.html
91•Zen1th•4h ago•13 comments

Show HN: Nano PDF – A CLI Tool to Edit PDFs with Gemini's Nano Banana

https://github.com/gavrielc/Nano-PDF
80•GavCo•3h ago•14 comments

Let go of StackOverflow; communities must take ownership

https://ahelwer.ca/post/2025-11-25-stackoverflow/
17•tensegrist•4d ago•7 comments

Blender facial animation tool. What else should it do?

https://github.com/shun126/livelinkface_arkit_receiver/wiki
20•happy-game-dev•2d ago•9 comments

The Origins of Scala (2009)

https://www.artima.com/articles/the-origins-of-scala
45•todsacerdoti•4h ago•21 comments

Zero knowlege proof of compositeness

https://www.johndcook.com/blog/2025/11/29/zkp-composite/
79•ColinWright•6h ago•26 comments

Show HN: Network Monitor – a GUI to spot anomalous connections on your Linux

90•grigio•5d ago•29 comments

An update on the Farphone's battery

https://far.computer/battery-update/
50•louismerlin•1d ago•40 comments

Post-mortem of Shai-Hulud attack on November 24th, 2025

https://posthog.com/blog/nov-24-shai-hulud-attack-post-mortem
65•makepanic•3d ago•51 comments

Rare X-ray images of a 4.5-ton satellite that returned intact from space

https://www.empa.ch/web/s604/eureca-satellit-mit-roentgenmethoden-untersucht
45•giuliomagnifico•3d ago•5 comments

We're learning more about what Vitamin D does

https://www.technologyreview.com/2025/11/21/1128206/vitamin-d-bodies-bone-health-immune/
109•Brajeshwar•7h ago•89 comments

Student perceptions of AI coding assistants in learning

https://arxiv.org/abs/2507.22900
47•victorbuilds•6h ago•58 comments

Testing shows automotive glassbreakers can't break modern automotive glass

https://www.core77.com/posts/138925/Testing-Shows-Automotive-Glassbreakers-Cant-Break-Modern-Auto...
64•surprisetalk•8h ago•60 comments

Hardening the C++ Standard Library at scale

https://queue.acm.org/detail.cfm?id=3773097
107•ndesaulniers•6d ago•49 comments

Datacenters in space aren't going to work

https://taranis.ie/datacenters-in-space-are-a-terrible-horrible-no-good-idea/
88•mindracer•10h ago•95 comments

AccessOwl (YC S22) Is Hiring a Technical Account Manager (IAM)

https://www.ycombinator.com/companies/accessowl/jobs/dGC3pcO-technical-account-manager-identity-a...
1•philipeller•7h ago

Leak confirms OpenAI is preparing ads on ChatGPT for public roll out

https://www.bleepingcomputer.com/news/artificial-intelligence/leak-confirms-openai-is-preparing-a...
468•fleahunter•12h ago•460 comments

The CRDT Dictionary: A Field Guide to Conflict-Free Replicated Data Types

https://www.iankduncan.com/engineering/2025-11-27-crdt-dictionary/
153•birdculture•12h ago•15 comments

Europe's New War on Privacy

https://unherd.com/2025/11/europes-new-war-on-privacy/
93•joecobb•3h ago•26 comments

Bronze Age mega-settlement in Kazakhstan has advanced urban planning, metallurgy

https://archaeologymag.com/2025/11/bronze-age-mega-settlement-in-kazakhstan/
111•CGMthrowaway•1w ago•26 comments

Hachi: An Image Search Engine

https://eagledot.xyz/hachi.md.html
120•warangal•10h ago•14 comments

Anthony Bourdain's Lost Li.st's

https://bourdain.greg.technology/
215•gregsadetsky•3d ago•69 comments

DNS LOC Record (2014)

https://blog.cloudflare.com/the-weird-and-wonderful-world-of-dns-loc-records/
126•mikejeays•10h ago•33 comments

Baboon: Data Modeling with Automatic Evolutions and tagless binary codecs

https://github.com/7mind/baboon
14•pshirshov•4h ago•6 comments

Framework Computer Now Sponsoring LVFS / Fwupd Development

https://www.phoronix.com/news/Framework-Sponsoring-LVFS
117•LorenDB•5h ago•31 comments