frontpage.
newsnewestaskshowjobs

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.

F-Droid 2.0

https://f-droid.org/2026/09/24/f-droid-2.0-a-new-chapter-for-android-freedom.html
1022•daveoc64•12h ago•276 comments

Show HN: Make cursed fonts like Times New Bastard

https://bastardica.mitpit.com
530•MitPitt•1d ago•77 comments

Show HN: Whiteboard (YC W26) – An open-source IDE for thoughtful software design

https://github.com/devdotfast/whiteboard
229•sidharthkmenon•10h ago•85 comments

Why is the liver so weirdly regenerative?

https://dynomight.substack.com/p/liver
306•jbotz•11h ago•167 comments

2DWillNeverDie

https://2dwillneverdie.com/
149•surprisetalk•2d ago•15 comments

Fearless SIMD v1.0

https://linebender.org/blog/fearless-simd-1-0/
210•verdagon•2d ago•32 comments

Rails World 2026 Opening Keynote [video]

https://www.youtube.com/watch?v=vDjW_dRyKXY
280•an0malous•1d ago•293 comments

Toyota is taking the Corolla electric

https://electrek.co/2026/09/23/toyota-best-selling-corolla-electric/
263•cisc•1d ago•432 comments

Using LLMs to trace alchemical knowledge and decode 17th century letters

https://resobscura.substack.com/p/ai-labs-need-to-start-funding-historical
96•benbreen•8h ago•14 comments

My weird new hobby: Wandering around Tokyo on Google Maps

https://ahmedhossamdev.com/writing/my-weird-new-hobby-wandering-around-tokyo/
254•ahmedhossamdev•2d ago•107 comments

Writing Parquet files using Haskell

https://www.datahaskell.org/blog/2026/09/18/writing-parquet-files-using-haskell.html
33•cosmic_quanta•2d ago•3 comments

Google’s Project Suncatcher to put ML infrastructure in space

https://blog.google/innovation-and-ai/models-and-research/google-research/google-project-suncatch...
139•xnx•14h ago•253 comments

Two-tier encryption in the UK

https://macanorak.com/two-tier-encryption-in-the-uk/
396•ReturnoftheHack•17h ago•382 comments

California is chasing wealth that has feet

https://blog.landeconomics.org/p/california-is-chasing-wealth-that
170•idbnstra•7h ago•487 comments

Book review: Is parallel programming hard, and, if so, what can you do about it?

https://ahelwer.ca/post/2026-09-21-concurrency-textbook/
101•ahelwer•3d ago•30 comments

The Board Game of the Alpha Nerds (2014)

https://grantland.com/features/diplomacy-the-board-game-of-the-alpha-nerds/
65•neonate•7h ago•26 comments

Show HN: Koi.rest – watch some fish and regain your balance

https://koi.rest
148•hxii•6h ago•38 comments

Show HN: Air-gapped file encryption as self-decrypting HTML page

https://cms-sfx-demo.apeleg.com/
45•emurlin•20h ago•15 comments

The Bayeux Tapestry: Woven by the Victors

https://www.historytoday.com/archive/out-margins/bayeux-tapestry-woven-victors
16•prismatic•1d ago•1 comments

Sourcehut account takeover via build logs (XSS in ansi2html)

https://blog.arusekk.pl/posts/srht-account-takeover/
89•arusekk•8h ago•13 comments

Security auditing in the age of (good enough) AI

https://blog.trailofbits.com/2026/09/18/auditing-in-the-age-of-good-enough-ai/
76•aray07•3d ago•8 comments

The forgotten battle of East Lansing

https://eastlansinginfo.news/the-forgotten-battle-of-east-lansing/
91•rmason•3d ago•14 comments

Opus 5.5 is good at explainer videos

https://launchvideo.io
168•iacguy•7h ago•99 comments

Forging 1024-bit RSA signatures in nearly SNFS time [pdf]

https://eprint.iacr.org/2026/2131.pdf
56•int0x29•13h ago•9 comments

Stable (YC W20) Is Hiring Product Engineers

https://www.usestable.com/careers/product-engineer
1•collinpham•9h ago

Geothermal heat map of US hot springs

https://www.soakingsprings.com/hot-springs/geothermal-map
95•armenarmen•1d ago•37 comments

WaveDigger: Dig into wireless signals to discover their physical locations

https://github.com/christianrowlands/wavedigger
97•882542F3884314B•1d ago•19 comments

Tutoring company tells parents to save their money and 'use AI instead'

https://www.afr.com/policy/health-and-education/tutoring-company-tell-parents-to-save-their-money...
92•theanonymousone•12h ago•157 comments

Nokia Design Archive (2025)

https://repo.aalto.fi/index.php?name=SO_b66a9391-dcf8-4399-8e87-611f84c3fc4c
213•pillars•18h ago•118 comments

Motor Characterization for Small Running Robots (2016)

https://robot-daycare.com/posts/2016-01-06-motor-characterization-for-small-running-robots/
33•loughnane•3d ago•1 comments