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.

Microsoft open-sources "the earliest DOS source code discovered to date"

https://arstechnica.com/gadgets/2026/04/microsoft-open-sources-the-earliest-dos-source-code-disco...
146•DamnInteresting•4h ago•32 comments

Amazon Web Services – Four Years and Out

https://www.adventuresinoss.com/aws-four-years/
39•RyeCombinator•1h ago•6 comments

Why Is Vivado 2026.1 Dropping Linux Support for Free Tier?

https://adaptivesupport.amd.com/s/question/0D5Pd00001YQLdMKAX/why-is-vivado-20261-dropping-linux-...
44•zdw•1h ago•7 comments

Scammers are abusing an internal Microsoft account to send spam links

https://techcrunch.com/2026/05/21/scammers-are-abusing-an-internal-microsoft-account-to-send-spam/
97•spike021•5h ago•21 comments

Wake up! 16b

https://hellmood.111mb.de/wake_up_16b_writeup.html
133•MaximilianEmel•5h ago•7 comments

Alexander Grothendieck Revolutionized 20th-Century Mathematics

https://www.quantamagazine.org/how-alexander-grothendieck-revolutionized-20th-century-mathematics...
23•anujbans•2h ago•1 comments

Time to talk about my writerdeck

https://veronicaexplains.net/my-first-writerdeck/
344•hggh•11h ago•202 comments

Green card seekers must leave U.S. to apply, Trump administration says

https://www.nytimes.com/2026/05/22/us/politics/green-card-changes-trump.html
763•tlhunter•1d ago•1291 comments

Buildcraft Is a Compiler Problem

https://mitander.xyz/posts/buildcraft-is-a-compiler-problem/
12•mitander•1d ago•0 comments

On The <dl> (2021)

https://benmyers.dev/blog/on-the-dl/
375•ravenical•16h ago•110 comments

My two-part desk setup (2025)

https://arslan.io/2025/11/18/my-two-part-desk-setup/
255•James72689•3d ago•151 comments

My I3-Emacs Integration

https://khz.ac/software/i3-integration.html
50•nosolace•6h ago•10 comments

Sales and Dungeons: Thermal printer TTRPG utility

https://sales-and-dungeons.app/
75•hyperific•1d ago•26 comments

'Fuck you, Bambu': How one private message could change the face of 3D printing

https://www.theverge.com/tech/931532/bambu-agpl-pawel-jarczak-open-source-threat-dmca-github
40•tambourine_man•1h ago•8 comments

Judson's Last Ride

https://www.realclearpolitics.com/articles/2026/05/22/judsons_last_ride_154150.html
81•NaOH•17h ago•4 comments

The Art of Money Getting

https://kk.org/cooltools/book-freak-210-the-art-of-money-getting/
251•dxs•17h ago•144 comments

Schlitz Is Gone, but First It's Getting One Last Hurrah

https://www.milwaukeemag.com/schlitz-is-gone/
20•NaOH•2d ago•6 comments

Byrne's Euclid

https://www.c82.net/euclid/
36•layer8•7h ago•10 comments

New map reveals lost roads of the Roman Empire

https://www.scientificamerican.com/article/new-high-resolution-map-transforms-what-we-know-about-...
65•sohkamyung•3d ago•7 comments

Hengefinder: Finding when the sun aligns with your street

https://victoriaritvo.com/blog/hengefinder/
131•evakhoury•1d ago•28 comments

Reverse engineering circuitry in a Spacelab computer from 1980

https://www.righto.com/2026/05/reverse-engineering-spacelab-computer.html
96•elpocko•13h ago•20 comments

.NET (OK, C#) finally gets union types

https://andrewlock.net/exploring-the-dotnet-11-preview-2-dotnet-gets-union-types/
174•ingve•1d ago•154 comments

Air France and Airbus found guilty of manslaughter over 2009 plane crash

https://www.bbc.com/news/articles/czd2qmdvmq6o
52•baal80spam•9h ago•26 comments

Show HN: Anyone interested in a tool helps to explore C++ ASTs

https://uvic-aurora.github.io/acav-manual/index.html
31•leomicv•2d ago•2 comments

80386 microcode disassembled

https://www.reenigne.org/blog/80386-microcode-disassembled/
237•nand2mario•17h ago•46 comments

-​-dangerously-skip-reading-code

https://olano.dev/blog/dangerously-skip/
131•fagnerbrack•20h ago•127 comments

Kindle loyalists scramble as Amazon turns page on old e-readers

https://www.reuters.com/business/retail-consumer/kindle-loyalists-scramble-amazon-turns-page-old-...
146•cf100clunk•4d ago•163 comments

PHP's Oddities

https://flowtwo.io/post/php%27s-oddities
110•thejoeflow•4d ago•131 comments

Revised^7 Report on Scheme, Large: Procedural Fascicle Draft is now public

https://r7rs.org/large/fascicles/proc/
23•pmcgoron•3d ago•4 comments

Making deep learning go brrrr from first principles (2022)

https://horace.io/brrr_intro.html
162•tosh•18h ago•59 comments