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

Comments

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

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

Multiprocessing all the way!

emmelaich•8mo ago
(2021)

Good article!

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

Meta Announces Nuclear Energy Projects, Unlocking Up to 6.6 GW

https://about.fb.com/news/2026/01/meta-nuclear-energy-projects-power-american-ai-leadership/
28•ChrisArchitect•14m ago•12 comments

Poison Fountain

https://rnsaffn.com/poison3/
81•atomic128•1h ago•54 comments

Gentoo Linux 2025 Review

https://www.gentoo.org/news/2026/01/05/new-year.html
231•akhuettel•7h ago•105 comments

A set of Idiomatic prod-grade katas for experienced devs transitioning to Go

https://github.com/MedUnes/go-kata
26•medunes•3d ago•4 comments

Ask HN: What Are You Working On? (January 2026)

48•david927•2h ago•146 comments

Happy 50th Birthday KIM-1

https://github.com/netzherpes/KIM1-Demo
47•JKCalhoun•5h ago•16 comments

"Food JPEGs" in Super Smash Bros. & Kirby Air Riders

https://sethmlarson.dev/food-jpegs-in-super-smash-bros-and-kirby-air-riders
210•SethMLarson•5d ago•52 comments

I dumped Windows 11 for Linux, and you should too

https://www.notebookcheck.net/I-dumped-Windows-11-for-Linux-and-you-should-too.1190961.0.html
514•smurda•7h ago•511 comments

BasiliskII Macintosh 68k Emulator Ported to ESP32-P4 / M5Stack Tab5

https://github.com/amcchord/M5Tab-Macintosh
63•rcarmo•7h ago•8 comments

C++ std::move doesn't move anything: A deep dive into Value Categories

https://0xghost.dev/blog/std-move-deep-dive/
191•signa11•2d ago•151 comments

Instagram data breach reportedly exposed the personal info of 17.5M users

https://www.engadget.com/cybersecurity/an-instagram-data-breach-reportedly-exposed-the-personal-i...
138•IvanAchlaqullah•3h ago•46 comments

The Concise TypeScript Book

https://github.com/gibbok/typescript-book
187•javatuts•13h ago•41 comments

My Home Fibre Network Disintegrated

https://alienchow.dev/post/fibre_disintegration/
225•alienchow•14h ago•193 comments

HTML-only conditional lazy loading (via preload and media)

https://orga.cat/blog/html-conditional-lazy-loading/
67•netol•7h ago•9 comments

You are not required to close your <p>, <li>, <img>, or <br> tags in HTML

https://blog.novalistic.com/archives/2017/08/optional-end-tags-in-html/
112•jen729w•1d ago•172 comments

Vojtux – Unofficial Linux Distribution Aimed at Visually Impaired Users

https://github.com/vojtapolasek/vojtux
104•TheWiggles•4d ago•26 comments

Finding and fixing Ghostty's largest memory leak

https://mitchellh.com/writing/ghostty-memory-leak-fix
575•thorel•1d ago•123 comments

KaraDAV – Lightweight Nextcloud compatible WebDAV server

https://github.com/kd2org/karadav
22•indigodaddy•6h ago•1 comments

Think of Pavlov

https://boz.com/articles/think-pavlov
86•kiyanwang•8h ago•41 comments

Show HN: I used Claude Code to discover connections between 100 books

https://trails.pieterma.es/
454•pmaze•1d ago•135 comments

More than one hundred years of Film Sizes

https://wichm.home.xs4all.nl/filmsize.html
78•exvi•10h ago•18 comments

Replace the Retiring Windows XP with Linux

https://www.linux.com/training-tutorials/replace-retiring-windows-xp-linux/
56•righthand•2h ago•19 comments

Code and Let Live

https://fly.io/blog/code-and-let-live/
417•usrme•1d ago•160 comments

Learning from Sudoku Solvers (2007)

http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-solvers.html
16•forks•5d ago•7 comments

CPU Counters on Apple Silicon: article + tool

https://blog.bugsiki.dev/posts/apple-pmu/
148•verte_zerg•4d ago•1 comments

Show HN: Ferrite – Markdown editor in Rust with native Mermaid diagram rendering

https://github.com/OlaProeis/Ferrite
216•OlaProis•17h ago•127 comments

Are We ... Yet?

https://wiki.mozilla.org/Areweyet
4•mooreds•27m ago•0 comments

'Bandersnatch': The Works That Inspired the 'Black Mirror' Interactive Feature (2019)

https://www.hollywoodreporter.com/tv/tv-news/black-mirror-bandersnatch-real-life-works-influences...
78•rafaepta•5d ago•32 comments

Show HN: Porting xv6 to HiFive Unmatched board

https://github.com/eyengin/xv6-riscv-unmatched
24•eyengin•1d ago•0 comments

AI is a business model stress test

https://dri.es/ai-is-a-business-model-stress-test
315•amarsahinovic•1d ago•304 comments