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.

I’ve built a virtual museum with nearly every operating system you can think of

https://virtualosmuseum.org/
333•andreww591•3h ago•68 comments

Apple unveils new accessibility features

https://www.apple.com/newsroom/2026/05/apple-unveils-new-accessibility-features-and-updates-with-...
473•interpol_p•7h ago•247 comments

I’ve joined Anthropic

https://twitter.com/karpathy/status/2056753169888334312
826•dmarcos•4h ago•325 comments

KV Cache Is Becoming the Memory Hierarchy of Inference

https://touchdown-labs.com/blog/kv-cache-memory-hierarchy-inference.html
34•matt_d•2d ago•5 comments

Gaussian Splat of a Strawberry

https://superspl.at/scene/84df8849
407•danybittel•8h ago•159 comments

Gentoo News: Copy Fail, Dirty Frag, and Fragnesia Kernel Vulnerabilities

https://www.gentoo.org/news/2026/05/19/copy-fail-fragnesia-vulnerabilities.html
64•akhuettel•3h ago•17 comments

Gemini 3.5 Flash: frontier intelligence with action

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-5/
169•meetpateltech•1h ago•90 comments

Show HN: Superlog (YC P26) – Observability that installs itself and fixes bugs

https://superlog.sh/
32•Magnanten•3h ago•27 comments

CISA Admin Leaked AWS GovCloud Keys on GitHub

https://krebsonsecurity.com/2026/05/cisa-admin-leaked-aws-govcloud-keys-on-github/
294•LelouBil•11h ago•133 comments

Intro to TLA+ for the LLM Era: Prompt Your Way to Victory

https://emptysqua.re/blog/intro-to-tla-plus-for-the-llm-era/
72•zdw•2d ago•17 comments

Gemini Omni

https://deepmind.google/models/gemini-omni/
59•meetpateltech•1h ago•16 comments

Hanoi’s humble beer glass and the memory of a nation

https://sundaylongread.com/2026/05/15/hanois-humble-beer-glass-and-the-memory-of-a-nation/
88•NaOH•1d ago•15 comments

I Found Ultra-Pure Quantum Crystals in an Abandoned Mine in the Atacama Desert

https://medium.com/@breid.at/ultra-pure-quantum-crystals-from-an-abandoned-mine-in-a-mysterious-d...
227•vi_sextus_vi•2d ago•92 comments

The last six months in LLMs in five minutes

https://simonwillison.net/2026/May/19/5-minute-llms/
675•yakkomajuri•17h ago•528 comments

KV Sharing, MHC, and Compressed Attention

https://magazine.sebastianraschka.com/p/recent-developments-in-llm-architectures
13•gmays•2h ago•0 comments

Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

https://safedep.io/mini-shai-hulud-strikes-again-314-npm-packages-compromised/
315•theanonymousone•14h ago•244 comments

Google Search as you know it is over

https://techcrunch.com/2026/05/19/google-search-as-you-know-it-is-over/
88•evo_9•1h ago•104 comments

Peter Neumann has died

https://www.tuhs.org/pipermail/tuhs/2026-May/033748.html
285•pabs3•15h ago•23 comments

Show HN: I made a 3D pose maker for artists

https://setpose.com/
56•augustvdv•5h ago•27 comments

An Apple (II) for Teacher

https://technicshistory.com/2026/05/19/an-apple-ii-for-teacher/
46•cfmcdonald•18h ago•15 comments

Show HN: Haystack – Review the PRs that need human attention

https://haystackeditor.com/
11•akshaysg•1d ago•5 comments

Deciphering the Hashihara Castle Town Map

https://www.obayashi.co.jp/en/kikan_obayashi/detail/kikan_64_project.html
3•1970-01-01•1h ago•0 comments

Polypad

https://polypad.amplify.com/
192•ivank•2d ago•23 comments

Google I/O

https://io.google/2026/
153•thanhhaimai•2h ago•199 comments

OpenBSD 7.9

https://www.openbsd.org/79.html
299•bradley_taunt•5h ago•209 comments

Cursor Introduces Composer 2.5

https://cursor.com/blog/composer-2-5
268•asar•1d ago•196 comments

Kv4p HT – A homebrew 1W radio (VHF or UHF) that plugs into an Android phone

https://www.kv4p.com/
155•krupan•3d ago•66 comments

Click (2016)

https://clickclickclick.click/
358•andrewzeno•20h ago•91 comments

AI, "Humanity", and Dr. Manhattan Syndrome: A Communications Intervention

https://www.personfamiliar.com/p/ai-humanity-and-dr-manhattan-syndrome
4•stalfosknight•1h ago•0 comments

'Comically bad' datasets used to train clinical models for stroke and diabetes

https://retractionwatch.com/2026/05/18/kaggle-dataset-clinical-models-stroke-diabetes/
27•leephillips•1h ago•5 comments