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

Comments

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

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

Multiprocessing all the way!

emmelaich•10mo ago
(2021)

Good article!

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

ArXiv Declares Independence from Cornell

https://www.science.org/content/article/arxiv-pioneering-preprint-server-declares-independence-co...
414•bookstore-romeo•8h ago•131 comments

Entso-E final report on Iberian 2025 blackout

https://www.entsoe.eu/publications/blackout/28-april-2025-iberian-blackout/
45•Rygian•1h ago•6 comments

Flash-KMeans: Fast and Memory-Efficient Exact K-Means

https://arxiv.org/abs/2603.09229
66•matt_d•3d ago•4 comments

Video Encoding and Decoding with Vulkan Compute Shaders in FFmpeg

https://www.khronos.org/blog/video-encoding-and-decoding-with-vulkan-compute-shaders-in-ffmpeg
18•y1n0•3d ago•1 comments

The Soul of a Pedicab Driver

https://www.sheldonbrown.com/pedicab.html
55•haritha-j•3h ago•13 comments

Google details new 24-hour process to sideload unverified Android apps

https://arstechnica.com/gadgets/2026/03/google-details-new-24-hour-process-to-sideload-unverified...
943•0xedb•19h ago•1013 comments

Drawvg Filter for FFmpeg

https://ayosec.github.io/ffmpeg-drawvg/
99•nolta•2d ago•18 comments

Just Put It on a Map

https://progressandpoverty.substack.com/p/just-put-it-on-a-map
30•surprisetalk•4d ago•5 comments

Full Disclosure: A Third (and Fourth) Azure Sign-In Log Bypass Found

https://trustedsec.com/blog/full-disclosure-a-third-and-fourth-azure-sign-in-log-bypass-found
193•nyxgeek•11h ago•53 comments

Too Much Color

https://www.keithcirkel.co.uk/too-much-color/
49•maguay•2d ago•24 comments

Drugwars for the TI-82/83/83 Calculators (2011)

https://gist.github.com/mattmanning/1002653/b7a1e88479a10eaae3bd5298b8b2c86e16fb4404
182•robotnikman•12h ago•60 comments

Building a Reader for the Smallest Hard Drive

https://www.willwhang.dev/Reading-MK4001MTD/
61•voctor•4d ago•15 comments

Push events into a running session with channels

https://code.claude.com/docs/en/channels
359•jasonjmcghee•12h ago•211 comments

Return of the Obra Dinn: spherical mapped dithering for a 1bpp first-person game

https://forums.tigsource.com/index.php?topic=40832.msg1363742#msg1363742
413•PaulHoule•3d ago•52 comments

Cursor Composer 2 is just Kimi K2.5 with RL

https://twitter.com/fynnso/status/2034706304875602030
141•mirzap•3h ago•61 comments

How the Turner twins are mythbusting modern technical apparel

https://www.carryology.com/insights/how-the-turner-twins-are-mythbusting-modern-gear/
272•greedo•2d ago•138 comments

Show HN: Sonar – A tiny CLI to see and kill whatever's running on localhost

https://github.com/RasKrebs/sonar
17•raskrebs•3h ago•12 comments

Show HN: Three new Kitten TTS models – smallest less than 25MB

https://github.com/KittenML/KittenTTS
467•rohan_joshi•21h ago•163 comments

Cockpit is a web-based graphical interface for servers

https://github.com/cockpit-project/cockpit
284•modinfo•16h ago•160 comments

FSF statement on copyright infringement lawsuit Bartz v. Anthropic

https://www.fsf.org/blogs/licensing/2026-anthropic-settlement
142•m463•3d ago•69 comments

4Chan mocks £520k fine for UK online safety breaches

https://www.bbc.com/news/articles/c624330lg1ko
408•mosura•22h ago•729 comments

The Reason Windows Hate Is Exploding: It's the End of Personal Computing [video]

https://www.youtube.com/watch?v=e7a89ZYcTo8
21•oldnetguy•1h ago•1 comments

Astral to Join OpenAI

https://astral.sh/blog/openai
1399•ibraheemdev•23h ago•854 comments

Noq: n0's new QUIC implementation in Rust

https://www.iroh.computer/blog/noq-announcement
223•od0•18h ago•35 comments

Delphi 13.1 Released, with ARM64 support

https://blogs.embarcadero.com/announcing-the-availability-of-rad-studio-13-florence-update-1/
19•nopakos•1h ago•6 comments

Scaling Karpathy's Autoresearch: What Happens When the Agent Gets a GPU Cluster

https://blog.skypilot.co/scaling-autoresearch/
199•hopechong•20h ago•83 comments

A Journey Through Infertility

https://pudding.cool/2026/03/ivf/
51•tchanukvadze•2d ago•36 comments

Be intentional about how AI changes your codebase

https://aicode.swerdlow.dev
142•benswerd•15h ago•67 comments

Clockwise acquired by Salesforce

https://www.getclockwise.com
128•nigelgutzmann•17h ago•63 comments

OpenBSD: PF queues break the 4 Gbps barrier

https://undeadly.org/cgi?action=article;sid=20260319125859
210•defrost•23h ago•60 comments