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

Comments

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

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

Multiprocessing all the way!

emmelaich•6mo ago
(2021)

Good article!

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

CachyOS: Fast and Customizable Linux Distribution

https://cachyos.org/
89•doener•2h ago•79 comments

Show HN: Boing

https://boing.greg.technology/
460•gregsadetsky•9h ago•86 comments

Show HN: Real-time system that tracks how news spreads across 200k websites

https://yandori.io/news-flow/
65•antiochIst•4d ago•16 comments

Zigbook Is Plagiarizing the Zigtools Playground

https://zigtools.org/blog/zigbook-plagiarizing-playground/
333•todsacerdoti•9h ago•80 comments

Bazzite: The next generation of Linux gaming

https://bazzite.gg/
454•doener•15h ago•327 comments

RL is more information inefficient than you thought

https://www.dwarkesh.com/p/bits-per-sample
34•cubefox•3d ago•5 comments

All it takes is for one to work out

https://alearningaday.blog/2025/11/28/all-it-takes-is-for-one-to-work-out-2/
601•herbertl•17h ago•270 comments

Meshtastic

https://meshtastic.org/
201•debo_•12h ago•38 comments

Landlock-Ing Linux

https://blog.prizrak.me/post/landlock/
224•razighter777•15h ago•87 comments

The space of minds

https://karpathy.bearblog.dev/the-space-of-minds/
15•Garbage•3h ago•3 comments

The HTTP Query Method

https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-14.html
211•Ivoah•4d ago•89 comments

What's Hiding Inside Haribo's Power Bank and Headphones?

https://www.lumafield.com/first-article/posts/whats-hiding-inside-haribos-power-bank-and-headphones
59•rozenmd•2d ago•16 comments

Datacenters in space aren't going to work

https://taranis.ie/datacenters-in-space-are-a-terrible-horrible-no-good-idea/
349•mindracer•23h ago•275 comments

Learning Feynman's Trick for Integrals

https://zackyzz.github.io/feynman.html
216•Zen1th•17h ago•30 comments

Jiga (YC W21) Is Hiring Product Designer

https://www.ycombinator.com/companies/jiga/jobs/Cco7vyK-product-designer-remote-europe
1•grmmph•6h ago

Americans no longer see four-year college degrees as worth the cost

https://www.nbcnews.com/politics/politics-news/poll-dramatic-shift-americans-no-longer-see-four-y...
333•jnord•14h ago•489 comments

Advice for crime analyst to break into data science

https://andrewpwheeler.com/2025/11/21/advice-for-crime-analyst-to-break-into-data-science/
11•speckx•1w ago•0 comments

A new Little Prince museum has opened its doors in Switzerland

https://www.lepetitprince.com/en/events-around-the-world/a-new-little-prince-museum-has-opened-it...
80•gnabgib•12h ago•47 comments

Blender facial animation tool. What else should it do?

https://github.com/shun126/livelinkface_arkit_receiver/wiki
96•happy-game-dev•2d ago•13 comments

Our Phosphorescent World

https://aeon.co/essays/the-cycling-of-phosphorus-is-the-basis-for-all-life-on-earth
29•the-mitr•5d ago•1 comments

Leak confirms OpenAI is preparing ads on ChatGPT for public roll out

https://www.bleepingcomputer.com/news/artificial-intelligence/leak-confirms-openai-is-preparing-a...
722•fleahunter•1d ago•641 comments

Silicon Valley's man in the White House is benefiting himself and his friends

https://www.nytimes.com/2025/11/30/technology/david-sacks-white-house-profits.html
68•fleahunter•3h ago•42 comments

Anthony Bourdain's Lost Li.st's

https://bourdain.greg.technology/
291•gregsadetsky•4d ago•87 comments

Matrix Core Programming on AMD CDNA Architecture

https://rocm.blogs.amd.com/software-tools-optimization/matrix-cores-cdna/README.html
39•salykova•4d ago•5 comments

Be Like Clippy

https://be-clippy.com/
313•Aloha•17h ago•195 comments

Dynamic Skillset Reference Architecture

https://chatbotkit.com/examples/dynamic-skillset-reference-architecture
12•_pdp_•4d ago•3 comments

Show HN: Nano PDF – A CLI Tool to Edit PDFs with Gemini's Nano Banana

https://github.com/gavrielc/Nano-PDF
136•GavCo•16h ago•30 comments

Show HN: Network Monitor – a GUI to spot anomalous connections on your Linux

137•grigio•6d ago•48 comments

Rare X-ray images of a 4.5-ton satellite that returned intact from space

https://www.empa.ch/web/s604/eureca-satellit-mit-roentgenmethoden-untersucht
93•giuliomagnifico•3d ago•18 comments

Testing shows automotive glassbreakers can't break modern automotive glass

https://www.core77.com/posts/138925/Testing-Shows-Automotive-Glassbreakers-Cant-Break-Modern-Auto...
137•surprisetalk•21h ago•172 comments