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•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.

Americans Are Smashing Flock Cameras

https://stateofsurveillance.org/news/flock-cameras-destroyed-nationwide-ice-backlash-2026/
258•rolph•1h ago•212 comments

I turned a $80 RK3562 Android tablet into a Debian Linux workstation

https://github.com/tech4bot/rk3562deb
127•tech4bot•5h ago•77 comments

I don't think AI will make your processes go faster

https://frederickvanbrabant.com/blog/2026-05-15-i-dont-think-ai-will-make-your-processes-go-faster/
347•TheEdonian•6h ago•265 comments

The occasional ECONNRESET

https://movq.de/blog/postings/2026-05-05/1/POSTING-en.html
29•zdw•1h ago•2 comments

Mercurial, 20 years and counting: how are we still alive and kicking? [video]

https://fosdem.org/2026/schedule/event/AGWUVH-mercurial-aint-you-dead-yet/
25•ibobev•2d ago•3 comments

Security researcher says Microsoft built a Bitlocker backdoor, releases exploit

https://www.techspot.com/news/112410-security-researcher-microsoft-secretly-built-backdoor-bitloc...
407•nolok•4h ago•170 comments

Hindenburg's Smoking Room

https://www.airships.net/hindenburg-smoking-room/
71•crescit_eundo•2d ago•32 comments

Meta deletes popular 1M follower account after Kuwaiti request

https://twitter.com/ryangrim/status/2055992439031185782
64•bhouston•1h ago•20 comments

Native all the way, until you need text

https://justsitandgrin.im/posts/native-all-the-way-until-you-need-text/
291•dive•6h ago•200 comments

EU weighs restricting use of US cloud platforms to process sensitive gov data

https://www.osnews.com/story/144943/eu-weighs-restricting-use-of-us-cloud-platforms-to-process-se...
36•abdelhousni•1h ago•4 comments

Prolog Basics Explained with Pokémon

https://unplannedobsolescence.com/blog/prolog-basics-pokemon/
152•birdculture•2d ago•27 comments

Every AI Subscription Is a Ticking Time Bomb for Enterprise

https://www.thestateofbrand.com/news/ai-subscription-time-bomb
295•mooreds•6h ago•283 comments

CUDA Books

https://github.com/alternbits/awesome-cuda-books
57•dariubs•5h ago•9 comments

High-Entropy Alloy

https://en.wikipedia.org/wiki/High-entropy_alloy
60•leonidasrup•3d ago•6 comments

Zerostack – A Unix-inspired coding agent written in pure Rust

https://crates.io/crates/zerostack/1.0.0
506•gidellav•20h ago•279 comments

AI is a technology not a product

https://daringfireball.net/2026/05/ai_is_technology_not_a_product
182•ch_sm•5h ago•64 comments

XS: A programming language. Anywhere, anytime, by anyone

https://xslang.org
24•yacin•3h ago•12 comments

Apple Silicon costs more than OpenRouter

https://www.williamangel.net/blog/2026/05/17/offline-llm-energy-use.html
228•datadrivenangel•6h ago•196 comments

WHO Declares Ebola Outbreak a Global Health Emergency

https://www.nytimes.com/2026/05/17/world/africa/ebola-congo-uganda-who-public-health-emergency.html
204•zzzeek•5h ago•113 comments

Mozilla to UK regulators: VPNs are essential privacy and security tools

https://blog.mozilla.org/netpolicy/2026/05/15/mozilla-to-uk-regulators-vpns-are-essential-privacy...
526•WithinReason•12h ago•230 comments

Scientists believe ibogaine can help veterans overcome PTSD

https://www.bbc.com/future/article/20260514-how-hallucinogenic-ibogaine-helps-veterans-overcome-ptsd
53•bushwart•6h ago•44 comments

Colossus: The Forbin Project

https://en.wikipedia.org/wiki/Colossus:_The_Forbin_Project
188•doener•2d ago•64 comments

A nicer voltmeter clock

https://lcamtuf.substack.com/p/a-nicer-voltmeter-clock
279•surprisetalk•19h ago•35 comments

Agentic Trading with Safe Guardrails

https://github.com/ShurikenTrade/shuriken-skills
34•jgan0978•5h ago•17 comments

Hosting a website on an 8-bit microcontroller

https://maurycyz.com/projects/mcusite/
203•zdw•17h ago•17 comments

Moving away from Tailwind, and learning to structure my CSS

https://jvns.ca/blog/2026/05/15/moving-away-from-tailwind--and-learning-to-structure-my-css-/
631•mpweiher•1d ago•352 comments

Dontsurveil.me

https://opencivics-labs.github.io/dontsurveil.me/c22.html
4•laurex•2h ago•1 comments

OpenAI and Government of Malta partner to roll out ChatGPT Plus to all citizens

https://openai.com/index/malta-chatgpt-plus-partnership/
287•bookofjoe•22h ago•308 comments

Mado: Fast Markdown linter written in Rust

https://github.com/akiomik/mado
39•nateb2022•2d ago•2 comments

How Diamonds Are Made

https://diamond.jaydip.me/
66•lemonberry•1d ago•42 comments