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

Comments

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

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

Multiprocessing all the way!

emmelaich•10mo ago
(2021)

Good article!

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

Fear and denial in Silicon Valley over social media addiction trial

https://www.bbc.com/news/articles/c86e3eglv2go
61•1659447091•58m ago•55 comments

Don't YOLO your file system

https://jai.scs.stanford.edu/
62•mazieres•2h ago•34 comments

Make macOS consistently bad (unironically)

https://lr0.org/blog/p/macos/
313•speckx•7h ago•224 comments

Improving Composer through real-time RL

https://cursor.com/blog/real-time-rl-for-composer
56•ingve•1d ago•11 comments

Show HN: Twitch Roulette – Find live streamers who need views the most

https://twitchroulette.net/
59•ellg•4h ago•31 comments

LG's new 1Hz display is the secret behind a new laptop's battery life

https://www.pcworld.com/article/3096432/lgs-new-1hz-display-is-the-secret-behind-a-new-laptops-ba...
142•robotnikman•4d ago•74 comments

Anatomy of the .claude/ folder

https://blog.dailydoseofds.com/p/anatomy-of-the-claude-folder
386•freedomben•12h ago•193 comments

Velxio 2.0 – Emulate Arduino, ESP32, and Raspberry Pi 3 in the Browser

https://github.com/davidmonterocrespo24/velxio
96•dmcrespo•6h ago•24 comments

Nashville library launches Memory Lab for digitizing home movies

https://www.axios.com/local/nashville/2026/03/16/nashville-library-digitize-home-movies
108•toomuchtodo•3d ago•28 comments

Colorado House passes bill to limit surveillance pricing and wage setting

https://coloradonewsline.com/briefs/surveillance-pricing-wage-setting/
54•jprs•6h ago•5 comments

ISBN Visualization

https://annas-archive.gd/isbn-visualization?
99•Cider9986•6h ago•16 comments

Sports Betting Is Everywhere, Especially on Credit Reports

https://libertystreeteconomics.newyorkfed.org/2026/03/sports-betting-is-everywhere-especially-on-...
8•m-hodges•2d ago•0 comments

Telnyx package compromised on PyPI

https://telnyx.com/resources/telnyx-python-sdk-supply-chain-security-notice-march-2026
91•ramimac•17h ago•99 comments

The Future of SCIP

https://sourcegraph.com/blog/the-future-of-scip
41•jdorfman•11h ago•16 comments

DOJ confirms FBI Director Kash Patel's personal email was hacked

https://arstechnica.com/tech-policy/2026/03/doj-confirms-fbi-director-kash-patels-personal-email-...
200•sebastian_z•5h ago•110 comments

Installing a Let's Encrypt TLS certificate on a Brother printer with Certbot

https://owltec.ca/Other/Installing+a+Let%27s+Encrypt+TLS+certificate+on+a+Brother+printer+automat...
191•8organicbits•12h ago•49 comments

Fets and Crosses: Tic-Tac-Toe built from 2458 discrete transistors

https://schilk.co/projects/fetsncrosses/
21•voxadam•3d ago•6 comments

Meow.camera

https://meow.camera/#4258783365322591678
201•surprisetalk•12h ago•49 comments

Explore the Hidden World of Sand

https://magnifiedsand.com/
185•RAAx707•4d ago•35 comments

Building FireStriker: Making Civic Tech Free

https://firestriker.org/blog/building-firestriker-why-im-making-civic-tech-free
96•noleary•1d ago•23 comments

‘Energy independence feels practical’: Europeans building mini solar farms

https://www.euronews.com/2026/03/26/suddenly-energy-independence-feels-practical-europeans-are-bu...
224•vrganj•17h ago•218 comments

Embracing Bayesian methods in clinical trials

https://jamanetwork.com/journals/jama/fullarticle/2847011
86•nextos•3d ago•9 comments

Type Construction and Cycle Detection

https://go.dev/blog/type-construction-and-cycle-detection
7•commotionfever•3d ago•0 comments

People inside Microsoft are fighting to drop mandatory Microsoft Account

https://www.windowscentral.com/microsoft/windows-11/people-inside-microsoft-are-fighting-to-drop-...
534•breve•12h ago•411 comments

Desk for people who work at home with a cat

https://soranews24.com/2026/03/27/japan-now-has-a-special-desk-for-people-who-work-at-home-with-a...
344•zdw•11h ago•129 comments

Capability-Based Security for Redox: Namespace and CWD as Capabilities

https://www.redox-os.org/news/nlnet-cap-nsmgr-cwd/
34•ejplatzer•7h ago•3 comments

Ask HN: Founders of estonian e-businesses – is it worth it?

96•udl•3d ago•49 comments

Automatically generate all 3D print files for organizing a drawer

https://geniecrate.com/
27•woktalk•2d ago•17 comments

Should QA exist?

https://www.rubick.com/should-qa-exist/
109•PretzelFisch•16h ago•138 comments

Solving Semantle with the Wrong Embeddings

https://victoriaritvo.com/blog/robust-semantle-solver/
20•evakhoury•3d ago•0 comments