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•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.

A recent experience with ChatGPT 5.5 Pro

https://gowers.wordpress.com/2026/05/08/a-recent-experience-with-chatgpt-5-5-pro/
333•_alternator_•8h ago•187 comments

Google broke reCAPTCHA for de-googled Android users

https://reclaimthenet.org/google-broke-recaptcha-for-de-googled-android-users
1078•anonymousiam•16h ago•372 comments

Using Claude Code: The unreasonable effectiveness of HTML

https://twitter.com/trq212/status/2052809885763747935
164•pretext•6h ago•89 comments

OpenAI’s WebRTC problem

https://moq.dev/blog/webrtc-is-the-problem/
333•atgctg•1d ago•83 comments

Mythical Man Month

https://martinfowler.com/bliki/MythicalManMonth.html
170•ingve•2d ago•115 comments

Making Julia as Fast as C++

https://flow.byu.edu/posts/julia-c++
9•d_tr•2d ago•2 comments

David Attenborough's 100th Birthday

https://www.bbc.com/news/articles/cp3pww9g0p5o
658•defrost•22h ago•129 comments

What causes lightning? The answer keeps getting more interesting

https://www.quantamagazine.org/what-causes-lightning-the-answer-keeps-getting-more-interesting-20...
63•Tomte•2d ago•9 comments

Wi is Fi: Understanding Wi-Fi 4/5/6/6E/7/8 (802.11 n/AC/ax/be/bn)

https://www.wiisfi.com/
255•homebrewer•2d ago•62 comments

AI is breaking two vulnerability cultures

https://www.jefftk.com/p/ai-is-breaking-two-vulnerability-cultures
343•speckx•17h ago•136 comments

AWS North Virginia data center outage – resolved

https://www.cnbc.com/2026/05/08/aws-outage-data-center-fanduel-coinbase.html
227•christhecaribou•1d ago•148 comments

Cartoon Network Flash Games

https://www.webdesignmuseum.org/flash-game-exhibitions/cartoon-network-flash-games
347•willmeyers•18h ago•108 comments

America's carpet capital: an empire and its toxic legacy

https://apnews.com/projects/pfas-forever-stained/
20•rawgabbit•2d ago•6 comments

The React2Shell Story

https://lachlan.nz/blog/the-react2shell-story/
150•mufeedvh•18h ago•8 comments

An Introduction to Meshtastic

https://meshtastic.org/docs/introduction/
456•ColinWright•23h ago•158 comments

You gave me a u32. I gave you root. (io_uring ZCRX freelist LPE)

https://ze3tar.github.io/post-zcrx.html
188•MrBruh•15h ago•109 comments

Teaching Claude Why

https://www.anthropic.com/research/teaching-claude-why
171•pretext•17h ago•82 comments

Can LLMs model real-world systems in TLA+?

https://www.sigops.org/2026/can-llms-model-real-world-systems-in-tla/
88•mad•18h ago•21 comments

Serving a website on a Raspberry Pi Zero running in RAM

https://btxx.org/posts/memory/
227•xngbuilds•19h ago•89 comments

Mojo 1.0 Beta

https://mojolang.org/
355•sbt567•1d ago•222 comments

Light without electricity? Glowing algae could make it possible

https://www.colorado.edu/today/2026/05/06/light-without-electricity-glowing-algae-could-make-it-p...
77•geox•2d ago•23 comments

The soul of maintaining a new machine

https://books.worksinprogress.co/book/maintenance-of-everything/communities-of-practice/the-soul-...
56•akkartik•3d ago•5 comments

PortalVR Motion – use any VR content in 2D with 3D tracked Joy-Cons

https://portalvr.io/motion
22•gfodor•2d ago•1 comments

Roadside Attraction

https://theoffingmag.com/essay/roadside-attraction/
22•aways•15h ago•3 comments

How to Optimize MongoDB Query Performance with Indexes

https://visualeaf.com/blog/mongodb-query-optimization-indexes/
12•RoxiHaidi•2d ago•2 comments

US Government releases first batch of UAP documents and videos

https://www.war.gov/UFO/
301•david-gpu•22h ago•439 comments

All means are fair except solving the problem

https://yosefk.com/blog/all-means-are-fair-except-solving-the-problem.html
60•akkartik•2d ago•46 comments

Bitter Lessons from the ISSpresso

https://mceglowski.substack.com/p/bitter-lessons-from-the-isspresso
104•zdw•2d ago•28 comments

EU calls VPNs "a loophole that needs closing" in age verification push

https://cyberinsider.com/eu-calls-vpns-a-loophole-that-needs-closing-in-age-verification-push/
239•muse900•5h ago•171 comments

When is your birthday? The math behind hash collisions

https://0xkrt26.github.io/math_behind_security/2026/05/08/birthday-problem.html
48•denismenace•14h ago•10 comments