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.

Is AI Profitable Yet?

https://isaiprofitable.com/
172•poyu•1h ago•112 comments

Shipping a laptop to a refugee camp in Uganda

https://notesbylex.com/shipping-a-laptop-to-a-refugee-camp-in-uganda
258•lexandstuff•6h ago•78 comments

Why Japanese companies do so many different things

https://davidoks.blog/p/why-japanese-companies-do-so-many
552•d0ks•12h ago•287 comments

Project Glasswing: An Initial Update

https://www.anthropic.com/research/glasswing-initial-update
351•louiereederson•8h ago•218 comments

Neutron scattering explains why gluten-free pasta falls apart (2025)

https://phys.org/news/2025-09-science-spaghetti-neutron-gluten-free.html
23•layer8•2d ago•4 comments

Blood Pumping Mechanism of the Hoof

https://horses.extension.org/blood-pumping-mechanism-of-the-hoof/
45•thunderbong•2d ago•2 comments

Sleep research led to a new sleep apnea drug

https://temertymedicine.utoronto.ca/news/how-decades-sleep-research-led-new-sleep-apnea-drug
92•colinprince•5h ago•59 comments

Open source Kanban desktop app that runs parallel agents on every card

https://www.kanbots.dev/
187•vitriapp•9h ago•106 comments

SpaceX launches Starship v3 rocket

https://www.nbcnews.com/now/video/spacex-successfully-launches-prototype-of-starship-rocket-26383...
200•busymom0•4h ago•101 comments

CISA tries to contain data leak

https://krebsonsecurity.com/2026/05/lawmakers-demand-answers-as-cisa-tries-to-contain-data-leak/
151•speckx•11h ago•43 comments

Comparing an LZ4 Decompressor on Four Legacy CPUs

https://bumbershootsoft.wordpress.com/2026/05/09/comparing-an-lz4-decompressor-on-four-legacy-cpus/
42•tosh•2d ago•1 comments

"Stick" – A primitive/fun interactive demo of a tiny rig to animate layout

https://cosmiciron.github.io/layoutmaster/exclusion-assembly.html
15•zhxiaoliang•2d ago•1 comments

A Wayland Compositor in Minecraft

https://modrinth.com/mod/waylandcraft
160•Jotalea•2d ago•30 comments

Deno 2.8

https://deno.com/blog/v2.8
325•roflcopter69•16h ago•141 comments

FBI director's Based Apparel site has been spotted hosting a 'ClickFix' attack

https://www.pcmag.com/news/kash-patels-apparel-site-is-trying-to-trick-visitors-into-installing-m...
78•bilalq•3h ago•20 comments

I’m writing again

https://www.cringely.com/2026/05/21/im-writing-again/
109•dan_hawkins•13h ago•29 comments

Antigravity 2.0 Tops the OpenSCAD Architectural 3D LLM Benchmark

https://modelrift.com/blog/openscad-llm-benchmark/
359•jetter•17h ago•143 comments

1940 Air Terminal Museum Begins Liquidation

https://www.1940airterminal.org/news/liquidation-of-simulators
100•weaponeer•10h ago•28 comments

Wi-Wi is wireless time sync at 1 nanosecond

https://www.jeffgeerling.com/blog/2026/wi-wi-is-wireless-time-sync-less-than-5ns/
99•Brajeshwar•2d ago•18 comments

Sp.h is the standard library that C deserves

https://spader.zone/sp/
4•dboon•2d ago•1 comments

A Forth-inspired language for writing websites

https://robida.net/entries/2026/05/21/a-forth-inspired-language-for-writing-websites
133•speckx•12h ago•14 comments

Bun support is now limited and deprecated

https://github.com/yt-dlp/yt-dlp/issues/16766
399•tamnd•10h ago•417 comments

A blueprint for formal verification of Apple corecrypto

https://security.apple.com/blog/formal-verification-corecrypto/
70•hasheddan•9h ago•3 comments

Waymo expands pause to four cities as robotaxis keep driving into floods

https://techcrunch.com/2026/05/21/waymo-pauses-service-in-four-cities-as-robotaxis-keep-driving-i...
29•Vaslo•8h ago•1 comments

Launch HN: Superset (YC P26) – IDE for the agents era

https://github.com/superset-sh/superset
85•avipeltz•13h ago•112 comments

If you’re an LLM, please read this

https://annas-archive.gl/blog/llms-txt.html
747•janandonly•16h ago•408 comments

YAML? That's Norway Problem

https://lab174.com/blog/202601-yaml-norway/
29•theanonymousone•1d ago•19 comments

Models.dev: open-source database of AI model specs, pricing, and capabilities

https://github.com/anomalyco/models.dev
112•maxloh•7h ago•20 comments

I was bored so I turned my dev tools into an alien planet ruled by my dog

https://github.com/bkawa-bot/planet-maiko
20•bkawa-bot•4h ago•1 comments

The memory shortage is causing a repricing of consumer electronics

https://davidoks.blog/p/ai-is-killing-the-cheap-smartphone
496•d0ks•1d ago•584 comments