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.

Exit IP VPN servers mitigation rollout

https://mullvad.net/en/help/exit-ip-vpn-servers-mitigation-rollout
117•Cider9986•2h ago•21 comments

Magnifica Humanitas

https://www.vatican.va/content/leo-xiv/en/encyclicals/documents/20260515-magnifica-humanitas.html
1100•theletterf•10h ago•494 comments

California moves to exempt Linux from its age-verification law after backlash

https://www.tomshardware.com/software/linux/california-moves-to-exempt-linux-from-its-upcoming-ag...
202•rbanffy•1h ago•107 comments

C extensions, portability, and alternative compilers

https://lemon.rip/w/6-c-extensions-compilers/
109•xngbuilds•6h ago•35 comments

Norway's 2 petabytes of Huawei flash storage and LLM training

https://www.blocksandfiles.com/flash/2026/05/22/norways-2-petabytes-of-huawei-flash-storage-and-l...
6•rbanffy•41m ago•0 comments

The bootstrapper's EU stack for under €10 per month

https://eualternative.eu/guides/bootstrapper-free-tier-eu-stack/
94•sparkling•1h ago•20 comments

Launch HN: Chert (YC P26) – Twilio for iMessage

https://www.trychert.com
39•garygao•5h ago•147 comments

Everyone Against Us (2023)

https://www.chicagomag.com/chicago-magazine/april-2023/everyone-against-us/
17•NaOH•5d ago•2 comments

Japan's New Hypersonic Engine Could Make 2-Hour Flights to the US a Reality

https://www.bgr.com/2178211/japan-hypersonic-engine-ramjet-2-hour-flights-to-us/
15•rmason•35m ago•4 comments

Weave (YC W25) is hiring ML, AI, product, & design engineers

https://jobs.ashbyhq.com/workweave
1•adchurch•2h ago

Netherlands Seizes 800 Servers, Arrests 2 for Aiding Cyberattacks

https://krebsonsecurity.com/2026/05/netherlands-seizes-800-servers-arrests-2-for-aiding-cyberatta...
219•jruohonen•6h ago•53 comments

Toshifumi Suzuki, founder of 7/11 Japan, has died

https://www.referenceforbusiness.com/biography/S-Z/Suzuki-Toshifumi-1932.html
17•L_Rahman•3h ago•9 comments

IBM Spins Off the First Pure-Play Quantum Chip Foundry

https://futurumgroup.com/insights/2-billion-chips-act-investment-in-quantum-bets-on-ibms-300mm-su...
117•rbanffy•10h ago•43 comments

CPPL: A Circuit Prompt Programming Language

https://arxiv.org/abs/2605.17892
15•chrsw•4d ago•0 comments

Alaska's oil revival sparks a new energy rush Into the Arctic

https://fortune.com/2026/05/24/alaska-oil-revival-energy-investment-arctic-drilling-national-petr...
28•Brajeshwar•1h ago•17 comments

Gnutella: A Protocol Outliving the World That Created It

https://rickcarlino.com/notes/p2p/gnutella-explanation.html
150•rickcarlino•3d ago•52 comments

Didgeridoo playing as alternative treatment for obstructive sleep apnoea (2006)

https://pmc.ncbi.nlm.nih.gov/articles/PMC1360393/
285•kelseyfrog•2d ago•141 comments

Jensen–Shannon Divergence

https://en.wikipedia.org/wiki/Jensen%E2%80%93Shannon_divergence
4•teleforce•3d ago•0 comments

Microsoft pulls plug on plans for 244-acre data center in Caledonia (2025)

https://www.tmj4.com/news/racine-county/microsoft-pulls-plug-on-plans-for-244-acre-data-center-in...
147•cdrnsf•7h ago•122 comments

Show HN: Audiomass – a free, open-source multitrack audio editor for the web

https://audiomass.co/?multitrack=1
488•pantelisk•1d ago•108 comments

He Lost It at the Movies

https://www.theideasletter.org/essay/he-lost-it-at-the-movies/
24•tintinnabula•4d ago•13 comments

DeepSeek reasonix, DeepSeek native coding agent with high caching and low cost

https://esengine.github.io/DeepSeek-Reasonix/
675•Alifatisk•1d ago•267 comments

Migrating from Go to Rust

https://corrode.dev/learn/migration-guides/go-to-rust/
419•jabits•1d ago•424 comments

The analog computer museum's online library

https://www.analogmuseum.org/english/library.html
18•nill0•2d ago•0 comments

The physicists who convinced Fermilab to send Brazil's emails

https://buttondown.com/blog/brazil-fermilab-email
42•maguay•4d ago•17 comments

Bytecode VMs in surprising places (2024)

https://dubroy.com/blog/bytecode-vms-in-surprising-places/
122•azhenley•3d ago•43 comments

AI errno(2) values

https://www.netmeister.org/blog/ai-errno.html
98•zdw•3d ago•18 comments

Show HN: Geomatic – A command-driven geometry studio enabled with autodiff

https://www.tinyvolt.com/geomatic
55•nivter•11h ago•13 comments

White Rabbit – sub-nanosecond synchronization for large distributed systems

https://ohwr.org/projects/white-rabbit/
175•michaelsbradley•2d ago•40 comments

I spent 50 hours drawing a line graph

https://www.dougmacdowell.com/50-hours-to-draw-some-lines.html
641•dougdude3339•4d ago•98 comments