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.

Filing the Corners Off MacBooks

https://kentwalters.com/posts/corners/
97•normanvalentine•55m ago•56 comments

Chimpanzees in Uganda locked in eight-year 'civil war', say researchers

https://www.bbc.com/news/articles/cr71lkzv49po
176•neversaydie•4h ago•96 comments

1D Chess

https://rowan441.github.io/1dchess/chess.html
595•burnt-resistor•7h ago•111 comments

WireGuard makes new Windows release following Microsoft signing resolution

https://lists.zx2c4.com/pipermail/wireguard/2026-April/009561.html
366•zx2c4•7h ago•103 comments

Industrial design files for Keychron keyboards and mice

https://github.com/Keychron/Keychron-Keyboards-Hardware-Design
256•stingraycharles•6h ago•81 comments

JSON Formatter Chrome Plugin Now Closed and Injecting Adware

https://github.com/callumlocke/json-formatter
114•jkl5xx•4h ago•62 comments

Nowhere Is Safe

https://steveblank.com/2026/04/09/nowhere-is-safe/
83•sblank•3h ago•126 comments

Watgo – A WebAssembly Toolkit for Go

https://eli.thegreenplace.net/2026/watgo-a-webassembly-toolkit-for-go/
60•ibobev•4h ago•5 comments

Show HN: FluidCAD – Parametric CAD with JavaScript

https://fluidcad.io/
92•maouida•4h ago•20 comments

Installing Every* Firefox Extension

https://jack.cab/blog/every-firefox-extension
26•RohanAdwankar•1h ago•3 comments

What is RISC-V and why it matters to Canonical

https://ubuntu.com/blog/risc-v-101-what-is-it-and-what-does-it-mean-for-canonical
72•fork-bomber•2d ago•36 comments

Helium Is Hard to Replace

https://www.construction-physics.com/p/helium-is-hard-to-replace
223•JumpCrisscross•8h ago•146 comments

CPU-Z and HWMonitor compromised

https://www.theregister.com/2026/04/10/cpuid_site_hijacked/
229•pashadee•9h ago•80 comments

Sam Altman's response to Molotov cocktail incident

https://blog.samaltman.com/2279512
5•jack_hanford•5m ago•1 comments

Launch HN: Twill.ai (YC S25) – Delegate to cloud agents, get back PRs

https://twill.ai
40•danoandco•6h ago•41 comments

Vinyl Cache and Varnish Cache

https://vinyl-cache.org/organization/on_vinyl_cache_and_varnish_cache.html
11•Foxboron•2d ago•0 comments

Bluesky April 2026 Outage Post-Mortem

https://pckt.blog/b/jcalabro/april-2026-outage-post-mortem-219ebg2
123•jcalabro•7h ago•61 comments

Bild AI (YC W25) Is Hiring a Founding Product Engineer

https://www.ycombinator.com/companies/bild-ai/jobs/dDMaxVN-founding-product-engineer
1•rooppal•6h ago

A security scanner as fast as a linter – written in Rust

https://github.com/peaktwilight/foxguard
34•peaktwilight•2d ago•7 comments

Show HN: A WYSIWYG word processor in Python

https://codeberg.org/chrisecker/miniword
50•chrisecker•4h ago•24 comments

You can't trust macOS Privacy and Security settings

https://eclecticlight.co/2026/04/10/why-you-cant-trust-privacy-security/
402•zdw•7h ago•143 comments

AI assistance when contributing to the Linux kernel

https://github.com/torvalds/linux/blob/master/Documentation/process/coding-assistants.rst
123•hmokiguess•4h ago•100 comments

Show HN: Eve – Managed OpenClaw for work

https://eve.new/login
17•zachdive•5h ago•15 comments

Clojure on Fennel Part One: Persistent Data Structures

https://andreyor.st/posts/2026-04-07-clojure-on-fennel-part-one-persistent-data-structures/
114•roxolotl•3d ago•10 comments

Simulating a 2D Quadcopter from Scratch

https://mrandri19.github.io/2026/04/03/2d-quadcopter-simulation.html
13•daww•2d ago•5 comments

Molotov cocktail is hurled at home of Sam Altman

https://www.nytimes.com/2026/04/10/us/open-ai-sam-altman-molotov-cocktail.html
143•enraged_camel•4h ago•348 comments

Combining spicy foods with mint boosts anti-inflammatory effects 100x or more

https://scitechdaily.com/this-spice-combo-could-slash-inflammation-hundreds-of-times-more-effecti...
59•joeax•2h ago•30 comments

The best seat in town

https://www.torched.la/the-best-seat-in-town/
30•NaOH•1d ago•8 comments

The difficulty of making sure your website is broken

https://letsencrypt.org/2026/04/10/test-sites.html
50•mcpherrinm•6h ago•22 comments

Mysteries of Dropbox: Testing of a Distributed Sync Service (2016) [pdf]

https://www.cis.upenn.edu/~bcpierce/papers/mysteriesofdropbox.pdf
97•JackeJR•3d ago•23 comments