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.

Can we have the day off?

https://mlsu.io/posts/day-off/
165•mlsu•45m ago•92 comments

YouTube to automatically label AI-generated videos

https://blog.youtube/news-and-events/improving-ai-labels-viewers-creators/
524•nopg•5h ago•316 comments

I think Anthropic and OpenAI have found product-market fit

https://simonwillison.net/2026/May/27/product-market-fit/
637•simonw•8h ago•776 comments

What Apple and Google are doing to push notifications

https://www.jacquescorbytuech.com/writing/what-apple-and-google-are-doing-your-push-notifications
168•iamacyborg•6h ago•171 comments

SimCity 3k in 4k (2025)

https://www.thran.uk/writ/hdid/2025/12/simcity-3k-in-4k.html
276•speckx•7h ago•106 comments

Rust (and Slint) on a Jailbroken Kindle

https://sverre.me/blog/rust-on-kindle/
99•homarp•5h ago•11 comments

A New Typst Template for Pandoc

https://imaginarytext.ca/posts/2025/typst-templates-for-pandoc/
26•ankitg12•1d ago•0 comments

DuckDuckGo search saw 28% more visits after Google said people love AI mode

https://www.pcgamer.com/hardware/duckduckgos-ai-free-search-saw-nearly-28-percent-more-visits-in-...
660•HelloUsername•8h ago•334 comments

FBI Arrests CIA Official with $40M in Gold Bars in His Home

https://www.nytimes.com/2026/05/27/us/politics/fbi-arrest-cia-official-gold-bars.html
56•cwwc•2h ago•21 comments

I'm Getting into Mesh Networks (Meshtastic, MeshCore, and Reticulum)

https://www.jonaharagon.com/posts/im-getting-into-mesh-networks-meshtastic-meshcore-and-reticulum/
58•Panda_•5h ago•18 comments

Pelica (YC P25) Is Hiring

https://www.ycombinator.com/companies/pelica/jobs/MDeC49o-machine-learning-engineer
1•lalitkundu•2h ago

Interleaved Deltas

https://mmapped.blog/posts/51-interleaved-deltas
28•surprisetalk•1d ago•0 comments

On Labubu and the Hyperreal

https://2earth.github.io/website/20260525.html
65•2earth•5h ago•76 comments

Go: Support for Generic Methods

https://github.com/golang/go/issues/77273
186•f311a•16h ago•144 comments

Incident with Pull Requests, Issues, Git Operations and API Requests

https://www.githubstatus.com/incidents/xy1tt3hs572m
258•maxnoe•13h ago•194 comments

Canada to order military plane fleet from Sweden in shift from US suppliers

https://www.theguardian.com/world/2026/may/27/canada-sweden-saab-globaleye-aircraft
403•tosh•8h ago•299 comments

Last.fm is now independent

https://support.last.fm/t/last-fm-is-now-independent/118591
619•twistslider•9h ago•175 comments

Claude Code as a Daily Driver: Claude.md, Skills, Subagents, Plugins, and MCPs

https://arps18.github.io/posts/claude-code-mastery/
369•arps18•20h ago•226 comments

Internet traffic in Iran increasing

https://radar.cloudflare.com/traffic/ir?dateRange=28d
62•Cider9986•3h ago•52 comments

Gemini, Gophers, and Fingers. Oh My Alternative Internets Beyond HTTPS

https://brennan.day/gemini-gophers-and-fingers-oh-my-alternative-internets-beyond-https/
89•ChrisArchitect•8h ago•45 comments

Mini Micro Fantasy Computer

https://miniscript.org/MiniMicro/index.html#about
232•nicoloren•15h ago•80 comments

Tech CEOs are apparently suffering from AI psychosis

https://techcrunch.com/2026/05/27/tech-ceos-are-apparently-suffering-from-ai-psychosis/
561•IAmGraydon•10h ago•284 comments

Stress disrupts hippocampal integration of overlapping events, memory inference

https://www.science.org/doi/10.1126/sciadv.aea5496?user_id=66c4bf745d78644b3aa57b08
74•gmays•8h ago•12 comments

Freediving, Embodiment and Humanity

https://tracesofhumanity.org/freediving-embodiment-and-humanity/
27•transpute•2d ago•13 comments

What Is a Direct Attach Copper (DAC) Cable? (2021)

https://www.servethehome.com/what-is-a-direct-attach-copper-dac-cable/
95•teleforce•2d ago•76 comments

Human Bottlenecks

https://borretti.me/article/human-bottlenecks
76•zdw•3d ago•24 comments

Private equity bought America's essential services

https://rubbishtalk.com/economy/how-private-equity-bought-americas-essential-services/
428•NoRagrets•13h ago•486 comments

Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)

https://www.thonking.ai/p/strangely-matrix-multiplications
154•tosh•4d ago•44 comments

You Should Not Update Your Dependencies

https://www.mendral.com/blog/you-should-not-update
21•OlivierCG•1h ago•5 comments

All of human cooking compressed into 2 megabytes

https://arxiv.org/abs/2605.22391
355•josefchen•17h ago•148 comments