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.

NIST scientists create 'any wavelength' lasers

https://www.nist.gov/news-events/news/2026/04/any-color-you-nist-scientists-create-any-wavelength...
224•rbanffy•8h ago•99 comments

Anonymous request-token comparisons from Opus 4.6 and Opus 4.7

https://tokens.billchambers.me/leaderboard
464•anabranch•12h ago•474 comments

Updating Gun Rocket through 10 years of Unity Engine

https://jackpritz.com/blog/updating-gun-rocket-through-10-years-of-unity-engine
50•tyleo•2d ago•14 comments

College instructor turns to typewriters to curb AI-written work

https://sentinelcolorado.com/uncategorized/a-college-instructor-turns-to-typewriters-to-curb-ai-w...
201•gnabgib•10h ago•184 comments

The electromechanical angle computer inside the B-52 bomber's star tracker

https://www.righto.com/2026/04/B-52-star-tracker-angle-computer.html
299•NelsonMinar•12h ago•86 comments

Zero-Copy GPU Inference from WebAssembly on Apple Silicon

https://abacusnoir.com/2026/04/18/zero-copy-gpu-inference-from-webassembly-on-apple-silicon/
54•agambrahma•6h ago•18 comments

Why Japan has such good railways

https://worksinprogress.co/issue/why-japan-has-such-good-railways/
347•RickJWagner•16h ago•344 comments

What Are Skiplists Good For?

https://antithesis.com/blog/2026/skiptrees/
8•mfiguiere•1d ago•0 comments

Modern Common Lisp with FSet

https://fset.common-lisp.dev/Modern-CL/Top_html/index.html
118•larve•3d ago•13 comments

State of Kdenlive

https://kdenlive.org/news/2026/state-2026/
357•f_r_d•17h ago•116 comments

Optimizing Ruby Path Methods

https://byroot.github.io/ruby/performance/2026/04/18/faster-paths.html
67•weaksauce•8h ago•25 comments

Migrating from DigitalOcean to Hetzner

https://isayeter.com/posts/digitalocean-to-hetzner-migration/
714•yusufusta•15h ago•368 comments

Thoughts and feelings around Claude Design

https://samhenri.gold/blog/20260418-claude-design/
264•cdrnsf•9h ago•173 comments

Metatextual Literacy

https://www.jenn.site/metatextual-literacy/
8•dado3212•3d ago•0 comments

Dizzying Spiral Staircase with Single Guardrail Once Led to Top of Eiffel Tower

https://www.smithsonianmag.com/smart-news/a-dizzying-spiral-staircase-with-a-single-guardrail-onc...
8•bookofjoe•2d ago•3 comments

Sumida Aquarium Posts 2026 Penguin Relationship Chart, with Drama and Breakups

https://www.sumida-aquarium.com/special/sokanzu/en/2026/
188•Lwrless•3d ago•7 comments

NASA Shuts Off Instrument on Voyager 1 to Keep Spacecraft Operating

https://science.nasa.gov/blogs/voyager/2026/04/17/nasa-shuts-off-instrument-on-voyager-1-to-keep-...
117•sohkamyung•5h ago•49 comments

Show HN: MDV – a Markdown superset for docs, dashboards, and slides with data

https://github.com/drasimwagan/mdv
102•drasim•13h ago•37 comments

My first impressions on ROCm and Strix Halo

https://blog.marcoinacio.com/posts/my-first-impressions-rocm-strix-halo/
28•random_•7h ago•15 comments

PgQue: Zero-Bloat Postgres Queue

https://github.com/NikolayS/pgque
99•gmcabrita•12h ago•24 comments

Scientists discover “cleaner ants” that groom giant ants in Arizona desert

https://www.sciencedaily.com/releases/2026/04/260414075641.htm
88•t-3•3d ago•34 comments

80386 Memory Pipeline

https://nand2mario.github.io/posts/2026/80386_memory_pipeline/
97•wicket•4d ago•13 comments

Floating Point Fun on Cortex-M Processors

https://danielmangum.com/posts/floating-point-cortex-m/
46•hasheddan•1d ago•5 comments

I dug into the Postgres sources to write my own WAL receiver

https://medium.com/@mailbox.sq7/a-long-story-about-how-i-dug-into-the-postgresql-source-code-to-w...
30•alzhi7•1d ago•3 comments

Understanding the FFT Algorithm (2013)

https://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/
70•peter_d_sherman•4d ago•7 comments

Fuzix OS

https://www.fuzix.org/
87•DeathArrow•13h ago•23 comments

Category Theory Illustrated – Orders

https://abuseofnotation.github.io/category-theory-illustrated/04_order/
236•boris_m•22h ago•60 comments

Show HN: SmallDocs – Markdown without the frustrations

67•FailMore•3d ago•29 comments

UpCodes (YC S17) is hiring SDRs to help make construction more productive

https://up.codes/careers?utm_source=HN
1•Old_Thrashbarg•11h ago

Bypassing the kernel for 56ns cross-language IPC

https://github.com/riyaneel/Tachyon/tree/main/docs/adr
13•riyaneel•2d ago•7 comments