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.

A statement about why RightsCon 2026 will not take place in Zambia

https://www.rightscon.org/rc26-statement/
32•benbreen•27m ago•2 comments

AI Uses Less Water Than the Public Thinks

https://californiawaterblog.com/2026/04/26/ai-water-use-distractions-and-lessons-for-california/
87•hirpslop•1h ago•53 comments

Uber Torches 2026 AI Budget on Claude Code in Four Months

https://www.briefs.co/news/uber-torches-entire-2026-ai-budget-on-claude-code-in-four-months/
321•lwhsiao•2h ago•342 comments

Ask HN: Who is hiring? (May 2026)

144•whoishiring•4h ago•155 comments

The Gay Jailbreak Technique

https://github.com/Exocija/ZetaLib/blob/main/The%20Gay%20Jailbreak/The%20Gay%20Jailbreak.md
90•bobsmooth•2h ago•31 comments

whohas – Command-line utility for cross-distro, cross-repository package search

https://github.com/whohas/whohas
74•peter_d_sherman•4h ago•17 comments

Flock cameras keep telling police a man who doesn't have a warrant has a warrant

https://www.youtube.com/watch?v=nHwxV0Sd9V8
129•johnbarron•1h ago•94 comments

Spotify adds 'Verified' badges to distinguish human artists from AI

https://www.bbc.com/news/articles/c5yerr4m1yno
26•reconnecting•2h ago•9 comments

Show HN: My Private GitHub on Postgres

https://github.com/calebwin/gitgres
21•calebhwin•1h ago•10 comments

It's Possible to Learn in Our Sleep. Should We?

https://www.newyorker.com/culture/annals-of-inquiry/its-possible-to-learn-in-our-sleep-should-we
10•XzetaU8•1h ago•1 comments

Ask HN: Who wants to be hired? (May 2026)

83•whoishiring•4h ago•156 comments

Sally McKee, who coined the term "the memory wall", has died

https://www.online-tribute.com/SallyMcKee
82•deater•4h ago•9 comments

Understand Anything

https://github.com/Lum1104/Understand-Anything
25•taubek•1h ago•4 comments

Show HN: WhatCable, a tiny menu bar app for inspecting USB-C cables

https://github.com/darrylmorley/whatcable
308•sleepingNomad•10h ago•112 comments

Running Adobe's 1991 PostScript Interpreter in the Browser

https://www.pagetable.com/?p=1854
101•ingve•7h ago•21 comments

The end of "Just ask Sarah"

https://simme.dev/posts/the-end-of-just-ask-sarah/
16•milkglass•2d ago•10 comments

I'm Peter Roberts, immigration attorney who does work for YC and startups. AMA

92•proberts•3h ago•138 comments

Show HN: AI CAD Harness

https://fusion.adam.new/install
8•zachdive•1h ago•1 comments

An open letter asking NHS England to keep its code open

https://keepthingsopen.com
143•tvararu•3h ago•7 comments

City Learns Flock Accessed Cameras in Children's Gymnastics Room as a Sales Demo

https://www.404media.co/city-learns-flock-accessed-cameras-in-childrens-gymnastics-room-as-a-sale...
20•joshcsimmons•29m ago•1 comments

Your Website Is Not for You

https://websmith.studio/blog/your-website-is-not-for-you/
222•pumbaa•7h ago•154 comments

The X-Files Has Made Me Nostalgic for a Time I Never Experienced

https://midnightmurmurations.substack.com/p/the-x-files-has-made-me-nostalgic
48•Teever•1h ago•13 comments

AWS stops billing Middle East cloud customers as repairs to war damage drag on

https://arstechnica.com/gadgets/2026/05/amazon-stuck-with-months-of-repairs-after-drone-strikes-o...
42•johnbarron•1h ago•12 comments

Artemis II Fault Tolerance

https://alearningaday.blog/2026/05/01/artemis-ii-fault-tolerance/
6•speckx•1h ago•0 comments

Advanced Quantization Algorithm for LLMs

https://github.com/intel/auto-round
100•lastdong•9h ago•14 comments

New copy of earliest poem in English, written 1,3k years ago, discovered in Rome

https://www.tcd.ie/news_events/articles/2026/caedmons-hymn-discovery/
185•giuliomagnifico•2d ago•112 comments

Show HN: Loopsy, a way for terminals and AI agents on different machines to talk

https://github.com/leox255/loopsy
32•todience•8h ago•7 comments

Show HN: Perfect Bluetooth MIDI for Windows

93•mayerwin•9h ago•29 comments

OpenWarp

https://openwarp.zerx.dev
180•zero-lab•16h ago•132 comments

Opus 4.7 knows the real Kelsey

https://www.theargumentmag.com/p/i-can-never-talk-to-an-ai-anonymously
447•ilamont•2d ago•240 comments