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.

I'm Tired of Talking to AI

https://orchidfiles.com/im-tired-of-ai-generated-answers/
454•theorchid•2h ago•271 comments

Incident with Pull Requests, Issues, Git Operations and API Requests

https://www.githubstatus.com/incidents/xy1tt3hs572m
75•maxnoe•39m ago•39 comments

Private Equity Bought America's Essential Services

https://rubbishtalk.com/economy/how-private-equity-bought-americas-essential-services/
28•NoRagrets•53m ago•5 comments

Mini Micro Fantasy Computer

https://miniscript.org/MiniMicro/index.html#about
86•nicoloren•2h ago•32 comments

The Melancholy of Slaying Monsters

https://thereader.mitpress.mit.edu/the-strange-melancholy-of-slaying-monsters/
154•prismatic•17h ago•61 comments

All of human cooking compressed into 2 megabytes

https://arxiv.org/abs/2605.22391
69•josefchen•4h ago•24 comments

Raft Consensus with a Minority of Nodes

https://padhye.org/raft-minority/
66•moarbugs•1d ago•5 comments

Cloudflare Flagship

https://developers.cloudflare.com/flagship/
261•tjek•13h ago•142 comments

XLIDE: VBA without excel

https://github.com/WilliamSmithEdward/xlide_vscode
4•sts153•46m ago•0 comments

BadHost – CVE-2026-48710: Starlette Host-Header Auth Bypass

https://badhost.org/
83•ylk•1d ago•33 comments

Claude Code as a Daily Driver: Claude.md, Skills, Subagents, Plugins, and MCPs

https://arps18.github.io/posts/claude-code-mastery/
128•arps18•7h ago•95 comments

That Methyl Methacrylate Tank

https://www.science.org/content/blog-post/methyl-methacrylate-tank
356•nooks•17h ago•149 comments

What Is a Direct Attach Copper (DAC) Cable

https://www.servethehome.com/what-is-a-direct-attach-copper-dac-cable/
37•teleforce•1d ago•16 comments

The worst job interview I ever had

https://www.oliverio.dev/blog/the-worst-job-interview-i-had
410•oliverio•16h ago•313 comments

Go: Support for Generic Methods

https://github.com/golang/go/issues/77273
12•f311a•3h ago•3 comments

A few interesting modern pixel fonts

https://unsung.aresluna.org/a-few-interesting-modern-pixel-fonts/
379•zdw•1d ago•81 comments

We are Poles, so, of course, we print in Latin

https://www.ustc.ac.uk/news/we-are-poles-so-of-course-we-print-in-latin
46•danielam•3d ago•5 comments

Matrix Multiplications on GPUs Run Faster When Given "Predictable" Data

https://www.thonking.ai/p/strangely-matrix-multiplications
3•tosh•4d ago•1 comments

I built a Git-tracked book production pipeline

https://www.djspeckhals.com/posts/2026-05-22-how-i-bypassed-adobe-and-microsoft-to-build-a-git-tr...
257•dustin1114•4d ago•64 comments

Show HN: Posthorn, self-hosted mail without the mail server

https://github.com/craigmccaskill/posthorn
53•craigmccaskill•8h ago•39 comments

Seeking a Language in Mathematics 1523-1571

https://tyndale.org/journals/reformj01/bmarsden.html
18•jruohonen•3d ago•2 comments

Rosalind: A genomics toolkit in Rust running whole-genome pipelines on a laptop

https://github.com/logannye/rosalind
172•samuell•5d ago•47 comments

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

https://www.minicor.com/
93•fchishtie•21h ago•56 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...
989•thm•23h ago•452 comments

A history of obituaries in American newspapers

https://blogs.loc.gov/headlinesandheroes/2026/05/mourn-not-a-history-of-obituaries-in-american-ne...
32•NaOH•2d ago•3 comments

C array types are weird

https://anselmschueler.com/blogposts/2025-c-pointers/
100•signa11•2d ago•104 comments

Sage Care (YC S24) Is Hiring Software Engineers

https://www.ycombinator.com/companies/sagecare/jobs/xtloH8r-senior-software-engineer
1•ian-gillis•19h ago

TSDuck: Open-source toolkit for MPEG-TS analysis and manipulation

https://tsduck.io/
45•phantomathkg•10h ago•4 comments

IBM Confidential: System/360 File Organization [video]

https://www.youtube.com/watch?v=zokKqP0plrM
51•DaiPlusPlus•2d ago•24 comments

A portentous reunion

https://bcantrill.dtrace.org/2026/05/25/a-portentous-reunion/
110•cafkafk•1d ago•31 comments