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.

We stopped AI bot spam in our GitHub repo using Git's –author flag

https://archestra.ai/blog/only-responsible-ai
217•ildari•2h ago•89 comments

Anthropic Acquires Stainless

https://www.anthropic.com/news/anthropic-acquires-stainless
57•tomeraberbach•44m ago•31 comments

Show HN: Files.md – Open-source alternative to Obsidian

https://github.com/zakirullin/files.md
324•zakirullin•4h ago•183 comments

The Quiet Renovation at Bitwarden

https://blog.ppb1701.com/the-quiet-renovation-at-bitwarden
223•DaSHacka•1d ago•103 comments

Project Glasswing: what Mythos showed us

https://blog.cloudflare.com/cyber-frontier-models/
148•Fysi•4h ago•57 comments

Two computers, one monitor, zero fiddling – Alex Plescan

https://alexplescan.com/posts/2025/08/16/kvm/
27•ankitg12•2d ago•22 comments

1024000^2 Blocks, 2B2T Minecraft Server World Download Project, and Discoveries

https://github.com/2b2tplace/1m_release
92•exploraz•3h ago•47 comments

Iran Starts Bitcoin-Backed Ship Insurance for Hormuz Strait

https://www.bloomberg.com/news/articles/2026-05-18/iran-starts-bitcoin-backed-shipping-insurance-...
24•srameshc•20m ago•7 comments

What Is Date:Italy?

http://aesthetikx.info/blog/date_italy.html
41•jollyjerry•2d ago•11 comments

Voice AI Systems Are Vulnerable to Hidden Audio Attacks

https://spectrum.ieee.org/voice-ai-audio-attacks
56•SVI•5h ago•16 comments

When Kierkegaard Got Cancelled

https://www.plough.com/en/topics/faith/discipleship/when-kierkegaard-got-cancelled
46•bookofjoe•5h ago•15 comments

The Aperiodic Table

https://blog.jgc.org/2026/05/the-aperiodic-table.html
56•jgrahamc•2d ago•21 comments

Qwen 3.7 Preview

https://twitter.com/Alibaba_Qwen/status/2056403591464984753
39•theanonymousone•1h ago•9 comments

'We mould trees to grow into the shape of chairs'

https://www.bbc.co.uk/news/articles/cvg0yy3gp71o
150•bauc•4h ago•37 comments

Actually, democracy dies in H.R.

https://www.nytimes.com/2026/05/18/world/americas/actually-democracy-dies-in-hr.html
182•mitchbob•3h ago•123 comments

Learn Harness Engineering

https://walkinglabs.github.io/learn-harness-engineering/en/
42•redbell•5h ago•1 comments

It is time to give up the dualism introduced by the debate on consciousness

https://www.noemamag.com/there-is-no-hard-problem-of-consciousness/
231•ahalbert4•14h ago•586 comments

Linux security mailing list 'almost unmanageable'

https://www.theregister.com/security/2026/05/18/linus-torvalds-says-ai-powered-bug-hunters-have-m...
160•jonbaer•5h ago•76 comments

GenCAD

https://gencad.github.io/
413•dagenix•20h ago•113 comments

Show HN: InsForge – Open-source Heroku for coding agents

https://github.com/InsForge/InsForge
11•mrcoldbrew•2h ago•2 comments

Elon Musk has lost his lawsuit against Sam Altman and OpenAI

https://techcrunch.com/2026/05/18/elon-musk-has-lost-his-lawsuit-against-sam-altman-and-openai/
9•nycdatasci•7m ago•0 comments

Porting my 3D points renderer on a ZX Spectrum 48K

https://github.com/ttsiodras/3D-on-a-ZX-Spectrum-48K/
62•ttsiodras•1d ago•9 comments

Cursor Introduces Composer 2.5

https://twitter.com/cursor_ai/status/2056415413077233983
15•asar•25m ago•1 comments

Enough with the AI FOMO, go slow-mo, says Domo CDO

https://www.theregister.com/ai-ml/2026/05/17/enough-with-the-ai-fomo-go-slow-mo-says-domo-cdo/524...
119•Bender•4h ago•63 comments

Crystals found inside wreckage from the first nuclear bomb test

https://www.scientificamerican.com/article/strange-crystals-found-inside-wreckage-from-the-first-...
151•jumploops•2d ago•71 comments

Don't answer the first question

https://lalitm.com/post/dont-answer-the-first-question/
57•lalitmaganti•8h ago•31 comments

Show HN: Auto-identity-remove – Automated data broker opt-out runner for macOS

https://github.com/stephenlthorn/auto-identity-remove
305•stephenlthorn•6h ago•122 comments

The foundations of a provably secure operating system (PSOS) (1979) [pdf]

http://www.csl.sri.com/users/neumann/psos.pdf
92•rurban•8h ago•57 comments

Ask an Astronaut: 333 hours of Q&A footage with astronauts

https://askanastronaut.issinrealtime.org/
188•gaws•2d ago•22 comments

Researchers Wanted Preschool Teachers to Wear Cameras to Train AI

https://www.404media.co/researchers-wanted-preschool-teachers-to-wear-cameras-to-train-ai/
50•cdrnsf•4h ago•13 comments