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.

You Can't Fool the Optimizer

https://xania.org/202512/03-more-adding-integers
46•HeliumHydride•51m ago•15 comments

Anthropic acquires Bun

https://bun.com/blog/bun-joins-anthropic
1928•ryanvogel•19h ago•912 comments

Mathematics is hard for mathematicians to understand too

https://www.science.org/doi/10.1126/science.aec9014
45•mmaaz•5d ago•30 comments

Zig quits GitHub, says Microsoft's AI obsession has ruined the service

https://www.theregister.com/2025/12/02/zig_quits_github_microsoft_ai_obsession/
426•Brajeshwar•5h ago•223 comments

IBM CEO says there is 'no way' spending on AI data centers will pay off

https://www.businessinsider.com/ibm-ceo-big-tech-ai-capex-data-center-spending-2025-12
626•nabla9•18h ago•690 comments

Interview with RollerCoaster Tycoon's Creator, Chris Sawyer (2024)

https://medium.com/atari-club/interview-with-rollercoaster-tycoons-creator-chris-sawyer-684a0efb0f13
143•areoform•8h ago•26 comments

A Look at Rust from 2012

https://purplesyringa.moe/blog/a-look-at-rust-from-2012/
11•todsacerdoti•1w ago•0 comments

AI agents break rules under everyday pressure

https://spectrum.ieee.org/ai-agents-safety
174•pseudolus•6d ago•83 comments

The "Mad Men" in 4K on HBO Max Debacle

http://fxrant.blogspot.com/2025/12/the-mad-men-in-4k-on-hbo-max-debacle.html
75•tosh•1h ago•23 comments

The Writing Is on the Wall for Handwriting Recognition

https://newsletter.dancohen.org/archive/the-writing-is-on-the-wall-for-handwriting-recognition/
68•speckx•6d ago•31 comments

Super fast aggregations in PostgreSQL 19

https://www.cybertec-postgresql.com/en/super-fast-aggregations-in-postgresql-19/
109•jnord•1w ago•9 comments

Paged Out

https://pagedout.institute
462•varjag•16h ago•50 comments

Researchers Find Microbe Capable of Producing Oxygen from Martian Soil

https://scienceclock.com/microbe-that-could-turn-martian-dust-into-oxygen/
41•ashishgupta2209•6h ago•20 comments

Quad9 DOH HTTP/1.1 Retirement, December 15, 2025

https://quad9.net/news/blog/doh-http-1-1-retirement/
75•pickledoyster•6h ago•20 comments

OpenAI declares 'code red' as Google catches up in AI race

https://www.theverge.com/news/836212/openai-code-red-chatgpt
705•goplayoutside•22h ago•780 comments

I designed and printed a custom nose guard to help my dog with DLE

https://snoutcover.com/billie-story
541•ragswag•3d ago•63 comments

Understanding ECDSA

https://avidthinker.github.io/2025/11/28/understanding-ecdsa/
74•avidthinker•8h ago•17 comments

Learning music with Strudel

https://terryds.notion.site/Learning-Music-with-Strudel-2ac98431b24180deb890cc7de667ea92
512•terryds•1w ago•122 comments

Trying Out C++26 Executors

https://mropert.github.io/2025/11/21/trying_out_stdexec/
23•ingve•5d ago•14 comments

Accepting US car standards would risk European lives

https://etsc.eu/accepting-us-car-standards-would-risk-european-lives-warn-cities-and-civil-society/
740•saubeidl•5h ago•551 comments

What, if anything, is universal to music cognition? (2024)

https://www.nature.com/articles/s41562-023-01800-9
26•Hooke•1w ago•16 comments

Qwen3-VL can scan two-hour videos and pinpoint nearly every detail

https://the-decoder.com/qwen3-vl-can-scan-two-hour-videos-and-pinpoint-nearly-every-detail/
216•thm•3d ago•64 comments

Zig's new plan for asynchronous programs

https://lwn.net/SubscriberLink/1046084/4c048ee008e1c70e/
304•messe•22h ago•217 comments

Counter Galois Onion: Improved encryption for Tor circuit traffic

https://blog.torproject.org/introducing-cgo/
85•wrayjustin•1w ago•27 comments

Amazon launches Trainium3

https://techcrunch.com/2025/12/02/amazon-releases-an-impressive-new-ai-chip-and-teases-a-nvidia-f...
181•thnaks•18h ago•65 comments

All about automotive lidar

https://mainstreetautonomy.com/blog/2025-08-29-all-about-automotive-lidar/
169•dllu•1d ago•67 comments

DOOM could have had PC Speaker Music

https://lenowo.org/viewtopic.php?t=45
102•minki_the_avali•13h ago•68 comments

School cell phone bans and student achievement

https://www.nber.org/digest/202512/school-cell-phone-bans-and-student-achievement
177•harias•19h ago•163 comments

Sending DMARC reports is somewhat hazardous

https://utcc.utoronto.ca/~cks/space/blog/spam/DMARCSendingReportsProblems
49•zdw•8h ago•18 comments

Load ZX Spectrum – first Museum dedicated to our first personal computer

https://loadzx.com/en/
60•elvis70•6d ago•27 comments