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

Comments

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

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

Multiprocessing all the way!

emmelaich•4mo ago
(2021)

Good article!

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

Apple: SSH and FileVault

https://keith.github.io/xcode-man-pages/apple_ssh_and_filevault.7.html
193•ingve•3h ago•54 comments

The Sagrada Família Takes Its Final Shape

https://www.newyorker.com/magazine/2025/09/22/is-the-sagrada-familia-a-masterpiece-or-kitsch
73•pseudolus•2d ago•24 comments

Nvidia buys $5B in Intel

https://www.tomshardware.com/pc-components/cpus/nvidia-and-intel-announce-jointly-developed-intel...
773•stycznik•12h ago•457 comments

Learn Your Way: Reimagining Textbooks with Generative AI

https://research.google/blog/learn-your-way-reimagining-textbooks-with-generative-ai/
215•FromTheArchives•5h ago•149 comments

This map is not upside down

https://www.maps.com/this-map-is-not-upside-down/
149•aagha•5h ago•248 comments

Want to piss off your IT department? Are the links not malicious looking enough?

https://phishyurl.com/
12•jordigh•43m ago•2 comments

Meta's live staged demo fails; the "AI" recording plays before the actor acts

https://old.reddit.com/r/LivestreamFail/comments/1nkbig7/metas_live_staged_demo_fails_the_ai_reco...
159•personjerry•2h ago•74 comments

Show HN: Asxiv.org – Ask ArXiv papers questions through chat

https://asxiv.org/
56•anonfunction•1w ago•4 comments

Configuration files are user interfaces

https://ochagavia.nl/blog/configuration-files-are-user-interfaces/
125•todsacerdoti•6h ago•69 comments

Launch HN: Cactus (YC S25) – AI inference on smartphones

https://github.com/cactus-compute/cactus
78•HenryNdubuaku•7h ago•35 comments

Rupert's snub cube and other Math Holes

http://tom7.org/ruperts/
14•QuadmasterXLII•2d ago•0 comments

Tldraw SDK 4.0

https://tldraw.dev/blog/tldraw-sdk-4-0
58•bpierre•4h ago•32 comments

TernFS – An exabyte scale, multi-region distributed filesystem

https://www.xtxmarkets.com/tech/2025-ternfs/
194•rostayob•8h ago•70 comments

KDE is now my favorite desktop

https://kokada.dev/blog/kde-is-now-my-favorite-desktop/
678•todsacerdoti•11h ago•540 comments

When Knowing Someone at Meta Is the Only Way to Break Out of "Content Jail"

https://www.eff.org/pages/when-knowing-someone-meta-only-way-break-out-content-jail
190•01-_-•4h ago•100 comments

Flipper Zero Geiger Counter

https://kasiin.top/blog/2025-08-04-flipper_zero_geiger_counter_module/
198•wgx•9h ago•64 comments

TIC-80 – Tiny Computer

https://tic80.com/
33•archargelod•3d ago•6 comments

Luau – Fast, small, safe, gradually typed scripting language derived from Lua

https://luau.org/
141•andsoitis•9h ago•64 comments

Slack has raised our charges by $195k per year

https://skyfall.dev/posts/slack
2788•JustSkyfall•21h ago•1216 comments

OpenTelemetry Collector: What It Is, When You Need It, and When You Don't

https://oneuptime.com/blog/post/2025-09-18-what-is-opentelemetry-collector-and-why-use-one/view
52•ndhandala•5h ago•18 comments

PostgreSQL Maintenance Without Superuser

https://boringsql.com/posts/postgresql-predefined-roles/
41•radimm•3d ago•1 comments

U.S. already has the critical minerals it needs, according to new analysis

https://www.minesnewsroom.com/news/us-already-has-critical-minerals-it-needs-theyre-being-thrown-...
83•giuliomagnifico•3h ago•86 comments

Aaron Levie: Startups win in the AI era [video]

https://www.youtube.com/watch?v=uqc_vt95GJg
50•sandslash•9h ago•20 comments

AI tools are making the world look weird

https://strat7.com/blogs/weird-in-weird-out/
3•gaaz•56m ago•0 comments

OneDev – Self-hosted Git server with CI/CD, Kanban, and packages

https://onedev.io/
76•jcbhmr•6h ago•37 comments

American Prairie unlocks another 70k acres in Montana

https://earthhope.substack.com/p/victory-for-public-access-american
245•mooreds•7h ago•159 comments

CERN Animal Shelter for Computer Mice (2011)

https://computer-animal-shelter.web.cern.ch/index.shtml
322•EbNar•16h ago•46 comments

Midcentury North American Restaurant Placemats

https://casualarchivist.substack.com/p/order-up
168•NaOH•2d ago•46 comments

The quality of AI-assisted software depends on unit of work management

https://blog.nilenso.com/blog/2025/09/15/ai-unit-of-work/
133•mogambo1•10h ago•85 comments

I Built an Event-Sourcing Database Engine: Meet Genesis DB

https://www.genesisdb.io
28•patriceckhart•3d ago•19 comments