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.

Cybersecurity researchers aren't happy about the guardrails on Anthropic's Fable

https://techcrunch.com/2026/06/10/cybersecurity-researchers-arent-happy-about-the-guardrails-on-a...
192•speckx•8h ago•183 comments

AI agent runs amok in Fedora and elsewhere

https://lwn.net/SubscriberLink/1077035/c7e7c14fbd60fae9/
69•tanelpoder•1h ago•6 comments

πFS

https://github.com/philipl/pifs
502•helterskelter•6h ago•132 comments

Raspberry Pi 5 – 16GB RAM

https://www.adafruit.com/product/6125?src=raspberrypi
159•akman•5h ago•188 comments

Anthropic requires 30 day data retention for Fable and Mythos

https://support.claude.com/en/articles/15425996-data-retention-practices-for-mythos-class-models
158•lebovic•1d ago•64 comments

A Written Language for the Cherokee So Efficient It Was Thought to Be Magic

https://www.smithsonianmag.com/innovation/man-created-written-language-cherokee-did-efficiently-e...
80•grahambargeron•3h ago•45 comments

I'm Eric Ries, author of "The Lean Startup" and new book "Incorruptible" – AMA

519•eries•10h ago•424 comments

How JPL keeps the 13-year-old Curiosity rover doing science

https://spectrum.ieee.org/curiosity-rover-jpl-mars-science
169•pseudolus•7h ago•35 comments

PgDog is funded and coming to a database near you

https://pgdog.dev/blog/our-funding-announcement
384•levkk•11h ago•197 comments

L'Affaire Siloxane

https://mceglowski.substack.com/p/laffaire-siloxane
153•idlewords•1d ago•23 comments

What is it like to be a bat? (1974) [pdf]

https://www.sas.upenn.edu/~cavitch/pdf-library/Nagel_Bat.pdf
62•shadow28•4h ago•50 comments

Deficient executive control in transformer attention

https://academic.oup.com/pnasnexus/article/5/6/pgag149/8698838
16•derbOac•1h ago•3 comments

Show HN: Extend UI – open-source UI kit for modern document apps

https://www.extend.ai/ui
148•kbyatnal•9h ago•36 comments

GeoLibre 1.0

https://geolibre.app/
148•jonbaer•7h ago•9 comments

World Capitals Voronoi

https://www.jasondavies.com/maps/voronoi/capitals/
34•vincnetas•2d ago•16 comments

Farmer donates land for a park, city sells it for $10M as data center land

https://www.tomshardware.com/tech-industry/farmer-donates-land-for-a-park-city-sells-it-for-data-...
399•maxloh•6h ago•194 comments

Who's the smartest corvid?

https://thetyee.ca/Culture/2026/06/05/Whos-the-Smartest-Corvid/
64•NaOH•1d ago•54 comments

Show HN: HelixDB – A graph database built on object storage

https://github.com/HelixDB/helix-db/tree/main
89•GeorgeCurtis•9h ago•30 comments

Building an HTML-first site doubled our users overnight

https://mohkohn.co.uk/writing/html-first/
994•edent•12h ago•453 comments

Claude Desktop spawns 1.8 GB Hyper-V VM on every launch, even for chat-only use

https://github.com/anthropics/claude-code/issues/29045
336•tonyrice•8h ago•240 comments

Apache Burr: Build reliable AI agents and applications

https://burr.apache.org/
172•anhldbk•10h ago•90 comments

Unix GC Remastered

https://mohandacherir.github.io/Qdiv7/posts/unix_new_gc/
10•mananaysiempre•2h ago•1 comments

Authentication issues related to API requests

https://www.githubstatus.com/incidents/fcj3088jg1wx
153•Multicomp•9h ago•30 comments

Why are there so many canines in fine art?

https://www.theatlantic.com/magazine/2026/07/the-dogs-gaze-thomas-w-laqueur/687312/
13•prismatic•3d ago•9 comments

Computer Lessons

https://technicshistory.com/2026/06/06/computer-lessons/
6•cfmcdonald•4d ago•0 comments

All 9,300 Japanese train station, animated by the year it opened (1872–2026)

https://jivx.com/eki
195•momentmaker•13h ago•67 comments

Anthropic's model naming, extrapolated

https://samwilkinson.io/posts/2026-06-09-anthropics-model-naming-extrapolated
278•sammycdubs•6h ago•78 comments

Smudging the game disc to make speedrunning 'SpongeBob' faster

https://www.inverse.com/input/gaming/the-dirty-secret-that-makes-speedrunning-on-spongebob-a-lot-...
72•pncnmnp•23h ago•42 comments

A €0.01 bank transfer could compromise a banking AI agent

https://blue41.com/blog/how-we-helped-bunq-secure-their-financial-ai-assistant/
165•tvissers•11h ago•150 comments

Policy on the AI Exponential

https://darioamodei.com/post/policy-on-the-ai-exponential
131•yjp20•6h ago•190 comments