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

Comments

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

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

Multiprocessing all the way!

emmelaich•12mo ago
(2021)

Good article!

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

Removable batteries in smartphones will be mandatory in the EU starting in 2027

https://www.ecopv-eu.com/en/blog-en/replaceable-smartphone-batteries-2027-eu-regulation/
103•rdeboo•46m ago•70 comments

Redis array: short story of a long development process

https://antirez.com/news/164
56•antirez•1h ago•6 comments

Talking to 35 Strangers at the Gym

https://thienantran.com/talking-to-35-strangers-at-the-gym/
528•thitran•4h ago•254 comments

GameStop makes $55.5B takeover offer for eBay

https://www.bbc.co.uk/news/articles/cn0p8yled1do
427•n1b0m•6h ago•363 comments

PyInfra 3.8.0 Is Out

https://github.com/pyinfra-dev/pyinfra/releases/tag/v3.8.0
124•wowi42•3h ago•42 comments

How Monero's proof of work works

https://blog.alcazarsec.com/tech/posts/how-moneros-proof-of-work-works
54•alcazar•1h ago•30 comments

Newton's law of gravity passes its biggest test

https://www.science.org/content/article/newton-s-law-gravity-passes-its-biggest-test-ever
65•pseudolus•3h ago•28 comments

Pomiferous: The most extensive apples (pommes) database

https://pomiferous.com/
4•Ariarule•1h ago•0 comments

Trademark violation: Fake Notepad++ for Mac

https://notepad-plus-plus.org/news/npp-trademark-infringement/
436•maxloh•6h ago•177 comments

Why are neural networks and cryptographic ciphers so similar? (2025)

https://reiner.org/neural-net-ciphers
71•jxmorris12•2d ago•23 comments

Using “underdrawings” for accurate text and numbers

https://samcollins.blog/underdrawings/
314•samcollins•2d ago•112 comments

World's biggest RC A380 [video]

https://www.youtube.com/watch?v=wr9YLGbhxng
87•NaOH•1d ago•41 comments

Texico: Learn the principles of programming without even touching a computer

https://www3.nhk.or.jp/nhkworld/en/shows/texico/
134•o4c•2d ago•9 comments

BYOMesh – New LoRa mesh radio offers 100x the bandwidth

https://partyon.xyz/@nullagent/116499715071759135
427•nullagent•21h ago•137 comments

DAG Workflow Engine

https://github.com/vivekg13186/Daisy-DAG
12•blobmty•3h ago•6 comments

Someone allegedly used a hairdryer to rig Polymarket weather bets

https://www.engadget.com/big-tech/someone-allegedly-used-a-hairdryer-to-rig-polymarket-weather-be...
87•cdrnsf•2h ago•42 comments

DeepClaude – Claude Code agent loop with DeepSeek V4 Pro

https://github.com/aattaran/deepclaude
582•alattaran•17h ago•245 comments

Discovering hard disk physical geometry through microbenchmarking (2019)

https://blog.stuffedcow.net/2019/09/hard-disk-geometry-microbenchmarking/
137•TapamN•3d ago•6 comments

A treasure trove of fossils rewrites the story of early life

https://www.quantamagazine.org/a-treasure-trove-of-cambrian-fossils-rewrites-the-story-of-early-l...
79•worldvoyageur•3d ago•15 comments

Southwest Headquarters Tour

https://katherinemichel.github.io/blog/travel/southwest-headquarters-tour-2026.html
295•KatiMichel•22h ago•89 comments

Fun with polynomials and linear algebra; or, slight abstract nonsense

https://guille.site/posts/abstract-nonsense/
44•LolWolf•3d ago•3 comments

Let's Buy Spirit Air

https://letsbuyspiritair.com/
486•bjhess•16h ago•469 comments

US–Indian space mission maps extreme subsidence in Mexico City

https://phys.org/news/2026-04-usindian-space-mission-extreme-subsidence.html
195•leopoldj•3d ago•70 comments

Why Almost Everyone Loses–Except a Few Sharks–On Prediction Markets

https://www.wsj.com/finance/investing/polymarket-kalshi-betting-profits-prediction-markets-eb23ac11
74•JumpCrisscross•4h ago•56 comments

OpenAI’s o1 correctly diagnosed 67% of ER patients vs. 50-55% by triage doctors

https://www.theguardian.com/technology/2026/apr/30/ai-outperforms-doctors-in-harvard-trial-of-eme...
460•donsupreme•1d ago•408 comments

Bad Connection: Global telecom exploitation by covert surveillance actors

https://citizenlab.ca/research/uncovering-global-telecom-exploitation-by-covert-surveillance-actors/
188•miohtama•23h ago•19 comments

Tar Files Created on macOS Display Errors When Extracting on Linux (2024)

https://aruljohn.com/blog/macos-created-tar-files-linux-errors/
136•heresie-dabord•4d ago•90 comments

Introduction to Atom

https://validator.w3.org/feed/docs/atom.html
120•susam•17h ago•55 comments

A desktop made for one

https://isene.org/2026/05/Audience-of-One.html
407•xngbuilds•1d ago•235 comments

New statue in London, attributed to Banksy, of a suited man, blinded by a flag

https://www.smithsonianmag.com/smart-news/attributed-to-banksy-a-new-statue-of-a-suited-man-blind...
499•dryadin•21h ago•490 comments