frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

How async/await works in Python (2021)

https://tenthousandmeters.com/blog/python-behind-the-scenes-12-how-asyncawait-works-in-python/
58•sebg•8h ago

Comments

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

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

Multiprocessing all the way!

emmelaich•6h ago
(2021)

Good article!

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

Paradox Interactive Anounces Europa Universalis 5

https://www.paradoxinteractive.com/games/europa-universalis-v/about
1•bibanez•3m ago•0 comments

You've Never Seen Copyright

https://blog.giovanh.com/blog/2023/10/25/youve-never-seen-copyright/
1•lr0•6m ago•0 comments

Project your earnings with some lines and charts (stripe analytics dashboard)

https://warpbin.com/stripe-analytics
1•warpbin•8m ago•1 comments

Sparky Distributed Jobs Flow

https://sparrowdo.wordpress.com/2025/05/09/sparky-distributed-jobs-flow/
1•melezhik•9m ago•0 comments

Héctor Germán Oesterheld

https://en.wikipedia.org/wiki/H%C3%A9ctor_Germ%C3%A1n_Oesterheld
1•Qem•10m ago•0 comments

The Beam

https://www.erlang-solutions.com/blog/the-beam-erlangs-virtual-machine/
1•Alupis•11m ago•0 comments

China's AI Job Mirage

https://chinamediaproject.org/2025/04/30/chinas-ai-job-mirage/
1•alastairr•12m ago•0 comments

Amateur Athletes Are Turning to Ozempic to Raise Their Game

https://www.wsj.com/health/wellness/ozempic-amateur-athletes-3fc9e0bf
1•bookofjoe•13m ago•1 comments

My Sermon on Open Source

https://philshapirochatgptexplorations.blogspot.com/2025/05/my-sermon-on-open-source.html
1•pshapiro99•15m ago•1 comments

37signals is completing its on-prem move, deleting its AWS account save millions

https://www.theregister.com/2025/05/09/37signals_cloud_repatriation_storage_savings/
3•Bender•16m ago•0 comments

Bluetooth 6.1

https://www.bluetooth.com/blog/delivering-on-the-bi-annual-release-schedule-bluetooth-core-6-1-is-here/
6•dabinat•17m ago•0 comments

Show HN: Scrape Creators – Real time Social media scraping APIs for devs

https://scrapecreators.com/
1•CodeBrief•17m ago•0 comments

Run your own MCP servers for 1000s of APIs

https://mcp.pipedream.com/developers
2•todsacerdoti•17m ago•1 comments

Books with a critical perspective on the tech industry

https://shepherd.com/best-books/critical-perspective-on-the-tech-industry
1•bwb•18m ago•1 comments

AI makes computers do what I want them to do

https://ericholscher.com/blog/2025/jan/5/ai-makes-computers-do-what-i-want/
2•alastairr•19m ago•0 comments

Books on how the desire for foods and drugs shaped the world

https://shepherd.com/best-books/how-the-desire-for-foods-and-drugs-shaped-the-worl
1•bwb•19m ago•1 comments

I created an AI Trading Platform, as well as a community of traders that use it

https://nexustrade.io/blog/i-created-an-ai-trading-platform-as-well-as-a-community-of-traders-that-use-it-its-free-20250509
2•austin-starks•20m ago•1 comments

Google Starts Scanning All Your Emails After Gmail Upgrade

https://www.forbes.com/sites/zakdoffman/2025/05/07/googles-gmail-upgrade-you-must-decide-if-this-goes-too-far/
4•l7l•20m ago•0 comments

India Supreme Court reverses content takedown order against Wikipedia operator

https://www.reuters.com/world/india/india-supreme-court-reverses-content-takedown-order-against-wikipedia-operator-2025-05-09/
3•alephnerd•20m ago•0 comments

Buntralino Make better, faster cross-platform desktop apps with Bun

https://buntralino.github.io/
1•tough•21m ago•0 comments

Podcast.today – Daily newsletters to discover new podcasts

https://www.podcast.today
1•jackjoliet•21m ago•1 comments

I've been here the whole time

https://brianredbeard.com/blog/ive_been_here_the_whole_time/
1•thebeardisred•21m ago•0 comments

How Warren Robinett Made Adventure on the Atari

http://www.warrenrobinett.com/inventing_adventure/
4•CaesarA•22m ago•0 comments

Quick, stable, self-contained: how we think about CI at Nerve

https://the-nerve-blog.ghost.io/quick-stable-self-contained-how-we-think-about-ci-at-nerve/
1•mprast•22m ago•0 comments

A.I. can't beat billions of years of natural selection

2•vitarnixofrtrnt•25m ago•2 comments

Cracking the Code: Deciphering How Concrete Can Heal Itself

https://stories.tamu.edu/news/2025/05/07/cracking-the-code-deciphering-how-concrete-can-heal-itself/
1•ulrischa•26m ago•0 comments

Valuable Information Leaked in LockBit Ransomware Hack

https://www.securityweek.com/valuable-information-leaked-in-lockbit-ransomware-hack/
1•Bender•28m ago•0 comments

India's costliest song shot 64 years ago, still rules hearts

https://www.siasat.com/indias-costliest-song-shot-64-years-ago-still-rules-hearts-3217629/
1•fork-bomber•29m ago•0 comments

Agent built in 3 minutes and used in multiagent orchestration

https://twitter.com/openservai/status/1920891587640299950
4•arbayi•34m ago•1 comments

Show HN: Generate Subresource Integrity (SRI)

https://sri-shasum.js.org
1•imcotton•38m ago•0 comments