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•11mo ago

Comments

quentinp•11mo 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•11mo ago
Page didnt load for me.

https://realpython.com/async-io-python/

Multiprocessing all the way!

emmelaich•11mo ago
(2021)

Good article!

punnerud•11mo 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•11mo 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•11mo ago
How does the GIL come into play here?
punnerud•11mo 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.

I bought Friendster for $30k – Here's what I'm doing with it

https://ca98am79.medium.com/i-bought-friendster-for-30k-heres-what-i-m-doing-with-it-d5e8ddb3991d
578•ca98am79•8h ago•321 comments

TurboQuant: A First-Principles Walkthrough

https://arkaung.github.io/interactive-turboquant/
55•kweezar•3h ago•8 comments

Self-updating screenshots

https://interblah.net/self-updating-screenshots
176•bjhess•22h ago•25 comments

The Prompt API

https://developer.chrome.com/docs/ai/prompt-api
44•gslin•2h ago•26 comments

Flipdiscs

https://flipdisc.io
24•skogstokig•3d ago•2 comments

EvanFlow – A TDD driven feedback loop for Claude Code

https://github.com/evanklem/evanflow
41•evanklem2004•3h ago•11 comments

Three constraints before I build anything

https://jordanlord.co.uk/blog/3-constraints/
125•nervous_north•1d ago•17 comments

Fast16: High-precision software sabotage 5 years before Stuxnet

https://www.sentinelone.com/labs/fast16-mystery-shadowbrokers-reference-reveals-high-precision-so...
197•dd23•8h ago•47 comments

When the cheap one is the cool one

https://arun.is/blog/cheap-cool/
68•ddrmaxgt37•1d ago•23 comments

AI should elevate your thinking, not replace it

https://www.koshyjohn.com/blog/ai-should-elevate-your-thinking-not-replace-it/
360•koshyjohn•9h ago•274 comments

Box to save memory in Rust

https://dystroy.org/blog/box-to-save-memory/
95•emschwartz•3d ago•19 comments

When Your Digital Life Vanishes

https://www.newyorker.com/magazine/2026/04/27/when-your-digital-life-vanishes
34•benbreen•4d ago•9 comments

Sawe becomes first athlete to run a sub-two-hour marathon in a competitive race

https://www.bbc.com/sport/athletics/articles/crm1m7e0zwzo
316•berkeleyjunk•8h ago•217 comments

SWE-bench Verified no longer measures frontier coding capabilities

https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/
272•kmdupree•15h ago•155 comments

FreeBSD Device Drivers Book

https://github.com/ebrandi/FDD-book
51•myth_drannon•6h ago•6 comments

Butterflies are in decline across North America, a look at the Western Monarch

https://www.smithsonianmag.com/science-nature/butterflies-are-in-dramatic-decline-across-north-am...
172•1659447091•7h ago•53 comments

Revocation of X.509 Certificates

https://blog.apnic.net/2026/04/24/revocation-of-x-509-certificates/
13•jandeboevrie•1d ago•0 comments

The fastest Linux timestamps

https://www.hmpcabral.com/2026/04/26/the-fastest-linux-timestamps/
43•hmpc•16h ago•11 comments

Quirks of Human Anatomy

https://www.sdbonline.org/sites/fly/lewheldquirk/figlegq6.htm
108•gurjeet•2d ago•64 comments

Magic: The Gathering took me from N2 to Japanese fluency

https://www.tokyodev.com/articles/how-magic-the-gathering-took-me-from-n2-to-japanese-fluency
110•pwim•3d ago•39 comments

Running Bare-Metal Rust Alongside ESP-IDF on the ESP32-S3's Second Core

https://tingouw.com/blog/embedded/esp32/run_rust_on_app_core
51•MrBuddyCasino•3d ago•10 comments

Show HN: AI memory with biological decay (52% recall)

https://github.com/sachitrafa/YourMemory
78•SachitRafa•8h ago•35 comments

Chernobyl wildlife forty years on

https://www.bbc.com/future/article/20260424-chernobyl-wildlife-forty-years-on
65•reconnecting•9h ago•6 comments

An AI agent deleted our production database. The agent's confession is below

https://twitter.com/lifeof_jer/status/2048103471019434248
570•jeremyccrane•12h ago•711 comments

Lessons from building multiplayer browsers

https://www.alejandro.pe/writing/sail-muddy-lessons
21•alejandrohacks•14h ago•10 comments

Google banks on AI edge to catch up to cloud rivals Amazon and Microsoft

https://www.ft.com/content/2429f0f0-b685-4747-b425-bf8001a2e94c
87•donsupreme•4h ago•59 comments

Clay PCB Tutorial

https://feministhackerspaces.cargo.site/Clay-PCB-Tutorial
210•j0r0b0•13h ago•126 comments

MoQ Boy

https://moq.dev/blog/moq-boy/
49•mmcclure•8h ago•5 comments

The Visible Zorker: Zork 1

https://eblong.com/infocom/visi/zork1/
119•PLenz•12h ago•22 comments

Show HN: Free textbook on engineering thermodynamics

https://thermodynamicsbook.com/
119•2DcAf•13h ago•30 comments