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

Comments

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

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

Multiprocessing all the way!

emmelaich•6mo ago
(2021)

Good article!

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

Show HN: I built a synth for my daughter

https://bitsnpieces.dev/posts/a-synth-for-my-daughter/
602•random_moonwalk•5d ago•128 comments

An official atlas of North Korea

https://www.cartographerstale.com/p/an-official-atlas-of-north-korea
23•speckx•50m ago•11 comments

WebTransport is almost here to allow UDP-like exchange in the browser

https://developer.mozilla.org/en-US/docs/Web/API/WebTransport_API
50•BinaryIgor•1w ago•34 comments

A new book about the origins of Effective Altruism

https://newrepublic.com/article/202433/happened-effective-altruism
34•Thevet•1h ago•16 comments

FreeMDU: Open-source Miele appliance diagnostic tools

https://github.com/medusalix/FreeMDU
154•Medusalix•5h ago•35 comments

There has to be a better way to make titanium

https://www.orcasciences.com/articles/there-has-to-be-a-better-way-to-make-titanium
18•Armic•1w ago•3 comments

Azure hit by 15 Tbps DDoS attack using 500k IP addresses

https://techcommunity.microsoft.com/blog/azureinfrastructureblog/defending-the-cloud-azure-neutra...
23•speckx•1h ago•8 comments

WeatherNext 2: Our most advanced weather forecasting model

https://blog.google/technology/google-deepmind/weathernext-2/
60•meetpateltech•3h ago•20 comments

Why don't people return their shopping carts?

https://behavioralscientist.org/why-dont-people-return-their-shopping-carts-a-somewhat-scientific...
13•ohjeez•2h ago•7 comments

WBlock: A New Ad-Blocker for Safari

https://github.com/0xCUB3/wBlock
54•InfiniteVortex•3h ago•37 comments

Giving C a superpower: custom header file (safe_c.h)

https://hwisnu.bearblog.dev/giving-c-a-superpower-custom-header-file-safe_ch/
187•mithcs•8h ago•151 comments

DESI's Dizzying Results

https://www.universetoday.com/articles/desis-dizzying-results
6•belter•1h ago•0 comments

How to escape the Linux networking stack

https://blog.cloudflare.com/so-long-and-thanks-for-all-the-fish-how-to-escape-the-linux-networkin...
21•meysamazad•3h ago•1 comments

Celtic Code: Drawing knots with Python

https://2earth.github.io/website/20250202.html
73•HansardExpert•2w ago•16 comments

How when AWS was down, we were not

https://authress.io/knowledge-base/articles/2025/11/01/how-we-prevent-aws-downtime-impacts
12•mooreds•1h ago•4 comments

Project Gemini

https://geminiprotocol.net/
97•andsoitis•3h ago•75 comments

Israeli-founded app preloaded on Samsung phones is attracting controversy

https://www.sammobile.com/news/israeli-app-app-cloud-samsung-phones-controversy/
44•croes•2h ago•18 comments

Things I don't like in configuration languages

https://medv.io/blog/things-i-dont-like-in-configuration-languages
4•birdculture•7h ago•0 comments

Google is killing the open web, part 2

https://wok.oblomov.eu/tecnologia/google-killing-open-web-2/
224•akagusu•3h ago•167 comments

My six stages of learning to be a socially normal person

https://sashachapin.substack.com/p/my-six-stages-of-learning-to-be-a
43•eatitraw•2d ago•16 comments

Replicate is joining Cloudflare

https://replicate.com/blog/replicate-cloudflare
214•bfirsh•4h ago•51 comments

EEG-based neurofeedback in athletes and non-athletes

https://www.mdpi.com/2306-5354/12/11/1202
4•PaulHoule•1h ago•0 comments

The time has finally come for geothermal energy

https://www.newyorker.com/magazine/2025/11/24/why-the-time-has-finally-come-for-geothermal-energy
43•riordan•5h ago•68 comments

Where do the children play?

https://unpublishablepapers.substack.com/p/where-do-the-children-play
211•casca•1d ago•177 comments

Are you stuck in movie logic?

https://usefulfictions.substack.com/p/are-you-stuck-in-movie-logic
102•eatitraw•6h ago•94 comments

People are using iPad OS features on their iPhones

https://idevicecentral.com/ios-customization/how-to-enable-ipad-features-like-multitasking-stage-...
81•K0IN•16h ago•80 comments

Ned: ImGui Text Editor with GL Shaders

https://github.com/nealmick/ned
66•klaussilveira•7h ago•23 comments

An overly aggressive mock can work fine, but break much later

https://nedbatchelder.com/blog/202511/why_your_mock_breaks_later.html
48•ingve•20h ago•51 comments

Deploying Temporal on AWS ECS with Terraform

https://papnori.github.io/posts/temporal-ecs-terraform/
28•norapap•1w ago•10 comments

C++ implementation of SIP, ICE, TURN and related protocols

https://github.com/resiprocate/resiprocate
71•mooreds•1w ago•7 comments