frontpage.
newsnewestaskshowjobs

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.

iPhone Duo

https://www.apple.com/iphone-duo/
824•thecosmicfrog•6h ago•1614 comments

Shopify acquires Tailwind

https://tailwindcss.com/blog/tailwind-is-joining-shopify
863•EdwinHoksberg•11h ago•346 comments

What do Visa and Mastercard do? An intro to card networks

https://tautology.town/2026/06/01/card-networks.html
335•evakhoury•1d ago•213 comments

AirPods 5

https://www.apple.com/newsroom/2026/09/apple-introduces-airpods-5-with-best-in-class-open-ear-act...
357•awad•6h ago•294 comments

Growing proof that autonomous cars save lives

https://spectrum.ieee.org/are-self-driving-cars-safe
188•bookofjoe•7h ago•313 comments

iPhone 18 Pro and iPhone 18 Pro Max

https://www.apple.com/newsroom/2026/09/apple-debuts-iphone-18-pro-and-iphone-18-pro-max/
258•meetpateltech•6h ago•267 comments

No Man's Sky Cosmos

https://www.nomanssky.com/cosmos-update/
279•Limb•8h ago•293 comments

GPT-6 Astra, looped transformers, and hidden reasoning

https://magazine.sebastianraschka.com/p/gpt-6-astra-looped-transformers-and
333•ModelForge•9h ago•117 comments

Apple Watch Series 12

https://www.apple.com/newsroom/2026/09/introducing-apple-watch-series-12-with-the-all-new-health-...
196•Lealen•6h ago•224 comments

Qwen 3.8 follows GPT-5.5 Pro reasoning prefills

https://gist.github.com/wsxiaoys/e0286dc6bb624ff5fdf49e7f4c528ba3
160•wsxiaoys•7h ago•67 comments

Desert Ant Labs: local, fast models that run on device

https://desertant.com/blog/introducing-desert-ant-labs/
377•willwhitedc•12h ago•90 comments

GNU Radio in the browser

https://gnuradioworld.com/
165•kristianpaul•8h ago•22 comments

How I advertise malicious software on Google Ads

https://xlii.space/eng/malicious-software-on-google-ads/
348•xlii•12h ago•209 comments

Understanding the recent DDoS attack against Read the Docs

https://about.readthedocs.com/blog/2026/09/2026-ddos-attack/
148•davidfischer•8h ago•49 comments

Planet Labs' open satellite feed

https://tech.marksblogg.com/planet-labs-open-satellite-feed.html
141•marklit•8h ago•26 comments

Use Vsock with Libzmq

https://blog.remijouan.net/posts/libzmq-vsock-pyzmq/
22•remijouannet•2d ago•2 comments

Electrostatic Cathode Ray Tube Project 1 (2014)

https://labguysworld.com/Project_ESCRTs_001.htm
9•userbinator•1d ago•1 comments

Blizzard Workers Win Historic Union Contract

https://www.gamespot.com/articles/blizzard-workers-win-historic-union-contract-that-could-set-a-n...
47•dbg31415•2h ago•2 comments

Factoring RSA 260

https://cognition.com/blog/factoring-rsa-260
5•samyok•4h ago•1 comments

Scanned, segmented, and animated my keyboard. Now you can type on my keyboard

https://chyuang.com/gaussian-splats/
4•yongyongyong•1d ago•0 comments

Muse, the band, lost its social media handles to Muse, Meta's new AI agent

https://www.engadget.com/2254419/muse-the-band-lost-its-social-media-handles-to-muse-meta-s-new-a...
13•_djo_•32m ago•1 comments

Bespoke: A programming language for people who say please

https://blog.hofstede.it/bespoke-a-programming-language-for-people-who-say-please/
118•birdculture•3d ago•28 comments

Ancient cave art suggests first known humans in Ireland walked over from Wales

https://www.bbc.com/news/articles/c5y75dl0jpko
45•bookofjoe•2d ago•9 comments

Muse – Meta’s personal AI agent

https://ai.meta.com/muse/
637•yks•1d ago•702 comments

Claude, change the “Add to Cart” button to blue

https://opusfived.dev/
982•matthieu_bl•14h ago•390 comments

Microsoft says email spammers are adopting ASCII smuggling

https://arstechnica.com/security/2026/09/once-popular-for-attacking-ai-ascii-smuggling-is-embrace...
37•utiiiD•4d ago•22 comments

Procedural Graphs: Self-Evolving Execution Structures for LLM Agents

https://arxiv.org/abs/2609.09153
41•omarsar•7h ago•12 comments

Why Emacs Consult async searches feel slow and how to speed them up

https://www.jamescherti.com/emacs-consult-speed-async-searche-grep-ripgrep-fd-find/
45•mpweiher•7h ago•18 comments

What will our economic future look like?

https://www.anthropic.com/institute/econ-scenarios
165•oumua_don17•10h ago•312 comments

Coyote v. Acme (1990)

https://www.newyorker.com/magazine/1990/02/26/coyote-v-acme
166•ChrisArchitect•3d ago•83 comments