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.

GitHub Actions down again today

https://www.githubstatus.com/?today
513•cebert•3h ago•258 comments

Don't Subscribe So Casually

https://thebestworstcase.substack.com/p/dont-subscribe-so-casually
23•shmublu•43m ago•17 comments

Launch HN: Minicor (YC P26) – Windows desktop automations at scale

https://www.minicor.com/
11•fchishtie•36m ago•5 comments

C64 Basic: Game Map Overhead "Camera View"

https://retrogamecoders.com/overhead-camera-view/
21•ibobev•1h ago•1 comments

Outsourcing plus LocalAI will soon become more economical vs. Frontier labs

https://www.signalbloom.ai/posts/outsourcing-plus-localai-will-soon-become-more-economical-vs-fro...
89•GodelNumbering•3h ago•90 comments

Using AI to write better code more slowly

https://nolanlawson.com/2026/05/25/using-ai-to-write-better-code-more-slowly/
929•signa11•16h ago•343 comments

Opaque Types in Python

https://blog.glyph.im/2026/05/opaque-types-in-python.html
51•lumpa•3d ago•7 comments

Netherlands blocks US takeover of vital digital supplier

https://www.politico.eu/article/netherlands-blocks-us-takeover-vital-digital-supplier/
264•vrganj•3h ago•96 comments

DynIP – Dynamic DNS with RFC 2136, IPv6, DNSSEC, and BYOD

https://dynip.dev/
234•dynip•7h ago•93 comments

Spain blocks prediction markets Polymarket, Kalshi over lack of gambling licence

https://www.reuters.com/business/spain-blocks-prediction-markets-polymarket-kalshi-over-lack-gamb...
118•thm•2h ago•52 comments

Eagle 3.1: Collaboration Between the EAGLE Team, vLLM Team, and TorchSpec Team

https://vllm.ai/blog/2026-05-26-eagle-3-1
51•berlianta•3h ago•16 comments

Taking a walk may lead to more creativity than sitting, study finds (2014)

https://www.apa.org/news/press/releases/2014/04/creativity-walk
456•bilsbie•17h ago•190 comments

Don't put aria-label on generic elements like divs

https://www.matuzo.at/blog/2026/aria-label-generic-elements
57•cyanbane•4d ago•31 comments

Phantasy Star IV – 1993 Developer Interviews

https://shmuplations.com/phantasystariv/
83•speckx•4d ago•34 comments

Incident with Actions and Pages

https://www.githubstatus.com/incidents/gnftqj9htp0g
54•hakube•4h ago•12 comments

How do you build a semiconductor company on something that's free?

https://www.siliconimist.com/p/the-open-source-silicon-business
43•johncole•4d ago•8 comments

Trying to preserve other peoples code

https://github.com/Essenceia/CRC_generator/tree/main
11•random__duck•3d ago•2 comments

Are we self-sovereign PKI yet?

https://buffrr.dev/blog/are-we-self-sovereign-pki-yet/
4•ca98am79•4d ago•0 comments

Stockholm poised to become leading European geospatial intel player

https://www.intelligenceonline.com/europe-russia/2026/05/26/stockholm-poised-to-become-leading-eu...
13•alephnerd•49m ago•0 comments

How Shamir's Secret Sharing Works

https://ente.com/blog/how-shamirs-secret-sharing-works/
303•subract•16h ago•52 comments

Ferrari Luce

https://www.ferrari.com/en-EN/auto/ferrari-luce
383•jumploops•18h ago•720 comments

Earthion: A New Mega Drive-Style Shoot-Em-Up

https://earthiongame.com/
114•MrBuddyCasino•11h ago•53 comments

A successful Japanese trial of a ramjet engine designed for Mach‑5 aircraft

https://www.bgr.com/2178211/japan-hypersonic-engine-ramjet-2-hour-flights-to-us/
211•rmason•19h ago•155 comments

Uber president says AI spending is getting 'harder to justify'

https://www.theverge.com/transportation/937116/uber-ai-investment-hard-to-justify
129•berlianta•5h ago•41 comments

What we lost when we stopped letting kids leave the front yard

https://stevemagness.substack.com/p/the-cost-of-safetyism
396•obscurette•1d ago•427 comments

Exposing Critical Vulnerabilities in CBSE's On-Screen Marking Portal

https://ni5arga.com/blog/posts/hacking-cbse/
37•dsr12•5h ago•7 comments

Exit IP VPN servers mitigation rollout

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

Toshifumi Suzuki, founder of Seven-Eleven Japan, has died

https://www.referenceforbusiness.com/biography/S-Z/Suzuki-Toshifumi-1932.html
248•L_Rahman•23h ago•99 comments

Multimodal adaptive optical microscope: in vivo imaging, molecules to organisms

https://www.nature.com/articles/s41592-026-03066-1
40•bookofjoe•3d ago•1 comments

Motorola phones have started hijacking the Amazon app to insert affiliate codes

https://9to5google.com/2026/05/25/motorola-amazon-app-hijacking-behavior/
316•Cider9986•11h ago•166 comments