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.

Hardware Attestation as Monopoly Enabler

https://grapheneos.social/@GrapheneOS/116550899908879585
850•ChuckMcM•7h ago•315 comments

Local AI needs to be the norm

https://unix.foo/posts/local-ai-needs-to-be-norm/
540•cylo•8h ago•262 comments

Running local models on an M4 with 24GB memory

https://jola.dev/posts/running-local-models-on-m4
67•shintoist•2h ago•36 comments

Incident Report: CVE-2024-YIKES

https://nesbitt.io/2026/02/03/incident-report-cve-2024-yikes.html
383•miniBill•7h ago•90 comments

Obsidian plugin was abused to deploy a remote access trojan

https://cyber.netsecops.io/articles/obsidian-plugin-abused-in-campaign-to-deploy-phantom-pulse-rat/
67•cmbailey•3h ago•31 comments

Guy Goma's Accidental BBC Interview Lives on After 20 Years

https://www.nytimes.com/2026/05/06/business/media/bbc-guy-goma-interview.html
47•nxobject•2d ago•11 comments

Ask HN: What are you working on? (May 2026)

123•david927•7h ago•443 comments

First tunnel element of the Fehmarnbelt Tunnel immersed

https://www.arup.com/en-us/news/first-fehmarnbelt-tunnel-element-lowered/
40•robin_reala•3d ago•9 comments

Make America AI Ready: Strengths, Weaknesses, and Recommendations

https://blog.citp.princeton.edu/2026/05/05/make-america-ai-ready-strengths-weaknesses-and-recomme...
13•Kye•1h ago•9 comments

AI Productivity Fails

https://blog.sshh.io/p/how-ai-productivity-fails
9•sshh12•1h ago•0 comments

PS3 Emulator Devs Politely Ask That People Stop Flooding It with AI PRs

https://kotaku.com/playstation-3-emulator-devs-politely-ask-that-people-stop-flooding-it-with-ai-...
57•stalfosknight•1h ago•31 comments

Traces Of Humanity

https://tracesofhumanity.org/hello-world/
127•alex77456•8h ago•19 comments

I designed Microsoft's EA channel in 2001. It's being dismantled in 2026

https://www.brendanoconnor.net/case-studies/microsoft-enterprise-channel/
5•brendo_y•2d ago•0 comments

The people preserving the scientific practice of bird banding

https://thenarwhal.ca/bird-banding-ontario/
30•bookofjoe•3d ago•0 comments

Maryland citizens hit with $2B power grid upgrade for out-of-state AI

https://www.tomshardware.com/tech-industry/artificial-intelligence/maryland-citizens-slapped-with...
134•lemonberry•4h ago•53 comments

You Need AI That Reduces Maintenance Costs

https://www.jamesshore.com/v2/blog/2026/you-need-ai-that-reduces-your-maintenance-costs
11•cratermoon•1h ago•1 comments

I returned to AWS and was reminded why I left

http://fourlightyears.blogspot.com/2026/05/i-returned-to-aws-and-was-reminded-hard.html
655•andrewstuart•1d ago•476 comments

Eight More 8-bit Era Microprocessors (2024)

https://thechipletter.substack.com/p/eight-more-8-bit-era-microprocessors
49•klelatti•2d ago•12 comments

Stop MitM on the first SSH connection, on any VPS or cloud provider

https://www.joachimschipper.nl/Stop%20MITM%20on%20the%20first%20SSH%20connection,%20on%20any%20VP...
77•JoachimSchipper•2d ago•45 comments

The locals don't know

https://www.quarter--mile.com/The-Locals-Dont-Know
98•herbertl•9h ago•68 comments

Lakebase architecture delivers faster Postgres writes

https://www.databricks.com/blog/how-lakebase-architecture-delivers-5x-faster-postgres-writes
94•sp_from_db•2d ago•29 comments

Idempotency is easy until the second request is different

https://blog.dochia.dev/blog/idempotency/
280•ludovicianul•3d ago•174 comments

What's a mathematician to do? (2010)

https://mathoverflow.net/questions/43690/whats-a-mathematician-to-do
149•ipnon•13h ago•73 comments

Louis Rossmann offers to pay legal fees for a threatened OrcaSlicer developer

https://www.tomshardware.com/3d-printing/louis-rossmann-tells-3d-printer-maker-bambu-lab-to-go-bl...
467•iancmceachern•10h ago•249 comments

Think Linear Algebra (2023)

https://allendowney.github.io/ThinkLinearAlgebra/index.html
165•tamnd•15h ago•17 comments

Show HN: An index of indie web/blog indexes

https://theindex.fyi
93•rocketpastsix•12h ago•32 comments

Task Paralysis and AI

https://g5t.de/articles/20260510-task-paralysis-and-ai/index.html
196•MrGilbert•19h ago•107 comments

James Schuyler's Genius

https://yalereview.org/article/james-schuylers-genius
5•Thevet•2d ago•0 comments

Space Cadet Pinball on Linux

https://brennan.io/2026/05/09/pinball-and-escrow/
312•jandeboevrie•14h ago•103 comments

Walking slower? Your ears, not your knees, might be the problem

https://www.wsj.com/health/wellness/hearing-loss-walking-speed-iphone-study-c53c482a
86•marc__1•1d ago•63 comments