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

Comments

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

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

Multiprocessing all the way!

emmelaich•12mo ago
(2021)

Good article!

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

Poland is now among the 20 largest economies. How it happened

https://apnews.com/article/poland-economy-growth-g20-gdp-26fe06e120398410f8d773ba5661e7aa
32•surprisetalk•19m ago•5 comments

Canvas is down as ShinyHunters threatens to leak schools’ data

https://www.theverge.com/tech/926458/canvas-shinyhunters-breach
750•stefanpie•14h ago•463 comments

Cloudflare to cut about 20% workforce

https://www.reuters.com/business/world-at-work/cloudflare-cut-over-1100-jobs-2026-05-07/
903•PriorityLeft•16h ago•606 comments

Nintendo announces price increases for Nintendo Switch 2

https://www.nintendo.co.jp/corporate/release/en/2026/260508.html
110•razorbeamz•5h ago•84 comments

Maybe you shouldn't install new software for a bit

https://xeiaso.net/blog/2026/abstain-from-install/
613•psxuaw•13h ago•333 comments

GeoJSON

https://geojson.org/
31•tosh•2h ago•12 comments

ClojureScript Gets Async/Await

https://clojurescript.org/news/2026-05-07-release
120•Borkdude•5h ago•37 comments

An Introduction to Meshtastic

https://meshtastic.org/docs/introduction/
11•ColinWright•1h ago•4 comments

Dirtyfrag: Universal Linux LPE

https://www.openwall.com/lists/oss-security/2026/05/07/8
687•flipped•17h ago•279 comments

The map that keeps Burning Man honest

https://www.not-ship.com/burning-man-moop/
678•speckx•22h ago•323 comments

Pinocchio is weirder than you remembered

https://storica.club/blog/pinocchio-in-italian/
201•cemsakarya•2d ago•84 comments

Dithering with CSS

https://ikesau.co/blog/dithering-with-css/
45•speckx•3d ago•16 comments

Hackers breach JDownloader website to serve malware-laced downloads

https://www.neowin.net/news/if-you-downloaded-this-popular-software-recently-you-might-have-insta...
15•bundie•29m ago•1 comments

The surprisingly complex journey to text-selectable client-side generated PDFs

https://sdocs.dev/blogs/journey-to-pdf-generation
38•FailMore•1d ago•32 comments

Rumors of my death are slightly exaggerated

398•CliffStoll•1d ago•59 comments

Agents need control flow, not more prompts

https://bsuh.bearblog.dev/agents-need-control-flow/
502•bsuh•20h ago•245 comments

A polynomial autoencoder beats PCA on transformer embeddings

https://ivanpleshkov.dev/blog/polynomial-autoencoder/
57•timvisee•3d ago•15 comments

DeepSeek 4 Flash local inference engine for Metal

https://github.com/antirez/ds4
423•tamnd•21h ago•119 comments

Natural Language Autoencoders: Turning Claude's Thoughts into Text

https://www.anthropic.com/research/natural-language-autoencoders
307•instagraham•18h ago•100 comments

Brazil's Pix payment system faces pressure from Visa and Mastercard

https://www.elciudadano.com/en/brazils-pix-payment-system-faces-pressure-from-visa-and-mastercard...
248•wslh•19h ago•219 comments

Singapore introduces caning for boys who bully others at school

https://www.theguardian.com/world/2026/may/06/singapore-caning-school-bullies
230•rustoo•2d ago•332 comments

Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE

https://github.com/graemeg/blaise
62•peter_d_sherman•8h ago•22 comments

AlphaEvolve: Gemini-powered coding agent scaling impact across fields

https://deepmind.google/blog/alphaevolve-impact/
305•berlianta•21h ago•129 comments

Hardening Firefox with Claude Mythos Preview

https://hacks.mozilla.org/2026/05/behind-the-scenes-hardening-firefox/
236•HieronymusBosch•20h ago•109 comments

Plasticity and language in the anaesthetized human hippocampus

https://www.bcm.edu/news/researchers-discover-advanced-language-processing-in-the-unconscious-hum...
123•hhs•13h ago•44 comments

GPT-5.5 Price Increase: What It Costs

https://openrouter.ai/announcements/gpt55-cost-analysis
87•gmays•11h ago•20 comments

GNU IFUNC is the real culprit behind CVE-2024-3094

https://github.com/robertdfrench/ifuncd-up
99•foltik•12h ago•45 comments

AI slop is killing online communities

https://rmoff.net/2026/05/06/ai-slop-is-killing-online-communities/
711•thm•18h ago•611 comments

Two Home Affairs officials suspended after AI 'hallucinations' found

https://www.citizen.co.za/news/home-affairs-officials-suspended-ai-hallucinations/
114•jruohonen•17h ago•25 comments

How to make SSE token streams resumable, cancellable, and multi-device

https://zknill.io/posts/everyone-said-sse-token-streaming-was-easy/
43•zknill•1d ago•10 comments