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•1y ago

Comments

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

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

Multiprocessing all the way!

emmelaich•1y ago
(2021)

Good article!

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

The newest Instagram “exploit” is the goofiest I've seen

https://www.0xsid.com/blog/meta-account-takeover-fiasco
563•ssiddharth•2h ago•137 comments

AI Agent Guidelines for CS336 at Stanford

https://github.com/stanford-cs336/assignment1-basics/blob/main/CLAUDE.md
125•prakashqwerty•2h ago•62 comments

Lifelike biochemistry continued to unfold in sterilized soil

https://www.quantamagazine.org/the-dirt-that-refused-to-die-20260601/
122•speckx•3h ago•30 comments

CS336: Language Modeling from Scratch

https://cs336.stanford.edu/
204•kristianpaul•4h ago•30 comments

Superintelligence: The Idea That Eats Smart People (2016)

https://idlewords.com/talks/superintelligence.htm
34•thoughtpeddler•1h ago•21 comments

Should you normalize RGB values by 255 or 256?

https://30fps.net/pages/255-vs-256-division/
20•pplanu•1h ago•0 comments

I made my phone slow on purpose

https://vinewallapp.com/notes/i-made-my-phone-slow-on-purpose/
96•gcampos•4d ago•81 comments

Ask HN: Who is hiring? (June 2026)

87•whoishiring•3h ago•116 comments

Flipper Zero Zig Template

https://github.com/NishantJoshi00/flipper-template
94•Nars088•5h ago•5 comments

A 10 year old Xeon is all you need

https://point.free/blog/gemma-4-on-a-2016-xeon/
580•cafkafk•12h ago•240 comments

Malicious npm packages detected across Red Hat Cloud Services

https://github.com/RedHatInsights/javascript-clients/issues/492
657•kurmiashish•5h ago•350 comments

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

39•whoishiring•3h ago•135 comments

The Pirate Bay Remains Resilient, 20 Years After the Raid

https://torrentfreak.com/the-pirate-bay-remains-resilient-20-years-after-the-raid/
342•speckx•4h ago•149 comments

Windows GOG DOS Games on M-Series Macs

https://f055.net/technology/windows-gog-dos-games-on-m-series-macs/
95•f055•5h ago•55 comments

Stealing from Biologists to Compile Haskell Faster

https://www.iankduncan.com/engineering/2026-05-30-stealing-from-biologists-to-compile-haskell-fas...
17•mooreds•2d ago•2 comments

Only 17% of all 64-bit Integers are products of two 32-bit integers

https://lemire.me/blog/2026/05/22/only-17-of-all-64-bit-integers-are-products-of-two-32-bit-integ...
142•sebg•4d ago•67 comments

Launch HN: Expanse (YC P26) – Unlock Wasted GPU Capacity

51•ismaeel_bashir•5h ago•11 comments

Sysadmining Like It's 2009

https://lambdacreate.com/posts/sysadmining-like-its-2009
58•yacin•5h ago•20 comments

Handmade Hawaiian Islands Map

https://www.notesfromtheroad.com/roam/hawaiian-islands-map.html
19•bovermyer•2d ago•9 comments

Nvidia RTX Spark

https://www.nvidia.com/en-us/products/rtx-spark/
171•shenli3514•13h ago•133 comments

Surface Laptop Ultra

https://blogs.windows.com/devices/2026/05/31/introducing-surface-laptop-ultra-made-for-world-makers/
74•berlianta•14h ago•116 comments

Linux Basics for Hackers (2019)

https://github.com/ahegazy0/linux-basics-for-hackers-notes
77•ibobev•5h ago•15 comments

DuckDuckGo makes its 'no-AI' search engine easier to access as its traffic booms

https://techcrunch.com/2026/06/01/duckduckgo-makes-its-no-ai-search-engine-easier-to-access-as-it...
223•jaredwiener•2h ago•110 comments

Anthropic confidentially submits draft S-1 to the SEC

https://www.anthropic.com/news/confidential-draft-s1-sec
256•surprisetalk•2h ago•172 comments

Radxa Dragon Q8B: A Laptop Cosplaying as an SBC?

https://bret.dk/radxa-dragon-q8b-a-laptop-cosplaying-as-an-sbc/
35•gainsurier•5h ago•28 comments

"The Apple Boogie" 1987 Mac Promo Album Cassette Tape [video]

https://www.youtube.com/watch?v=chJHB-btMNI
34•1970-01-01•2d ago•9 comments

Tracing HTTP Requests with Go's net/HTTP/httptrace

https://blainsmith.com/articles/httptrace-with-go/
147•speckx•4d ago•9 comments

Show HN: A CSS 3D Engine (no WebGL)

https://github.com/LayoutitStudio/polycss
36•rofko•4h ago•14 comments

KDE at 30

https://kde.org/anniversaries/30/
171•Kye•4h ago•74 comments

Chuwi Minibook X

https://tylercipriani.com/blog/2026/05/28/chuwi-minibook-x/
375•thcipriani•19h ago•280 comments