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.

Project Hail Mary – Stellar Navigation Chart

https://valhovey.github.io/gaia-mary/
530•speleo•8h ago•128 comments

The memory shortage is causing a repricing of consumer electronics

https://davidoks.blog/p/ai-is-killing-the-cheap-smartphone
67•d0ks•3h ago•14 comments

Using Kagi Search with Low Vision

https://veroniiiica.com/using-kagi-search-with-low-vision/
118•speckx•5h ago•19 comments

Blog ran on Ubuntu 16.04 for 10 years. I migrated it to FreeBSD

https://crocidb.com/post/this-blog-ran-on-ubuntu-16-04-for-10-years-i-migrated-it-to-freebsd/
156•speckx•6h ago•88 comments

The IBM-ification of Google?

https://zeroshot.bearblog.dev/google-is-shattering-under-its-own-weight-the-ibm-ification-of-google/
20•sabatonfan•1h ago•17 comments

We're testing new ad formats in Search and expanding our Direct Offers pilot

https://blog.google/products/ads-commerce/google-marketing-live-search-ads/
559•sofumel•15h ago•506 comments

Was my $48K GPU server worth it?

https://rosmine.ai/2026/05/13/was-my-48k-gpu-worth-it/
267•apwheele•3d ago•201 comments

Show HN: Freenet, a peer-to-peer platform for decentralized apps

https://freenet.org/
183•sanity•10h ago•95 comments

Uv is fantastic, but its package management UX is a mess

https://www.loopwerk.io/articles/2026/uv-ux-mess/
55•nchagnet•4h ago•33 comments

Indexing a year of video locally on a 2021 MacBook with Gemma4-31B (50GB swap)

https://blog.simbastack.com/indexed-a-year-of-video-locally/
281•asenna•11h ago•91 comments

Spotify will start reserving concert tickets for fans

https://www.hollywoodreporter.com/music/music-industry-news/spotify-will-start-reserving-concert-...
93•elffjs•8h ago•194 comments

Python 3.15: features that didn't make the headlines

https://blog.changs.co.uk/python-315-features-that-didnt-make-the-headlines.html
326•rbanffy•13h ago•158 comments

Launch HN: Runtime (YC P26) – Sandboxed coding agents for everyone on a team

https://www.runtm.com/
64•gustrigos•8h ago•19 comments

Seattle Shield, an intelligence-sharing network operated by the Seattle police

https://prismreports.org/2026/05/20/seattle-shield-private-companies-surveillance/
405•root-parent•7h ago•166 comments

Waymo pauses Atlanta service as its robotaxis keep driving into floods

https://techcrunch.com/2026/05/21/waymo-pauses-atlanta-service-as-its-robotaxis-keep-driving-into...
245•mattas•8h ago•310 comments

Lost Images from the 1945 Trinity Nuclear Test Restored

https://spectrum.ieee.org/trinity-nuclear-test
278•pseudolus•14h ago•92 comments

Flipper One – we need your help

https://blog.flipper.net/flipper-one-we-need-your-help/
1033•sandebert•14h ago•415 comments

Mycorrhizal Fungi, Nature's Key to Plant Survival and Success

https://pacifichorticulture.org/articles/mycorrhizal-fungi-natures-key-to-plant-survival-and-succ...
24•mooreds•1d ago•3 comments

BBEdit 16

https://www.barebones.com/products/bbedit/bbedit16.html
262•qaz_plm•6h ago•80 comments

Where are all the UK red telephone kiosks?

https://www.thek6project.co.uk/
69•Kaibeezy•7h ago•41 comments

Google's Antigravity bait and switch

https://www.0xsid.com/blog/antigravity-bait-n-switch
521•ssiddharth•11h ago•261 comments

ParadeDB (YC S23) Is Hiring Distributed Systems/Platform Engineers

1•philippemnoel•8h ago

News outlets are limiting the Internet Archive’s access to their journalism

https://www.niemanlab.org/2026/05/more-than-340-local-news-outlets-are-limiting-the-internet-arch...
206•jaredwiener•8h ago•77 comments

Mounting git commits as folders with NFS (2023)

https://jvns.ca/blog/2023/12/04/mounting-git-commits-as-folders-with-nfs/
90•pvtmert•2d ago•44 comments

Show HN: Agent.email – sign up via curl, claim with a human OTP

53•adisingh13•8h ago•63 comments

Vivaldi 8.0

https://vivaldi.com/blog/vivaldi-on-desktop-8-0/
344•OuterVale•17h ago•230 comments

Throwing AI-generated walls of text into conversations

https://noslopgrenade.com/
485•napolux•15h ago•288 comments

Replacing My ISP Router with a UniFi Cloud Gateway Max

https://kevquirk.com/replacing-my-isp-router-with-a-unifi-cloud-gateway-max
6•speckx•2d ago•6 comments

Multi-Stream LLMs: new paper on parallelizing/separating prompts, thinking, I/O

https://arxiv.org/abs/2605.12460
48•atomicthumbs•5h ago•4 comments

Museum of Pocket Calculating Devices

https://www.calculators.de/
71•ohjeez•9h ago•15 comments