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

Comments

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

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

Multiprocessing all the way!

emmelaich•7mo ago
(2021)

Good article!

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

Sharp Monocular View Synthesis in Less Than a Second

https://apple.github.io/ml-sharp/
202•dvrp•2h ago•42 comments

A linear-time alternative for Dimensionality Reduction and fast visualisation

https://medium.com/@roman.f/a-linear-time-alternative-to-t-sne-for-dimensionality-reduction-and-f...
7•romanfll•19m ago•0 comments

Erdős Problem #1026

https://terrytao.wordpress.com/2025/12/08/the-story-of-erdos-problem-126/
40•tzury•2h ago•2 comments

Quill OS: An open-source OS for Kobo's eReaders

https://quill-os.org/
210•Curiositry•6h ago•68 comments

Children with cancer scammed out of millions fundraised for their treatment

https://www.bbc.com/news/articles/ckgz318y8elo
7•1659447091•48m ago•0 comments

JetBlue flight averts mid-air collision with US Air Force jet

https://www.reuters.com/world/americas/jetblue-flight-averts-mid-air-collision-with-us-air-force-...
192•divbzero•8h ago•92 comments

8M users' AI conversations sold for profit by "privacy" extensions

https://www.koi.ai/blog/urban-vpn-browser-extension-ai-conversations-data-collection
342•takira•4h ago•110 comments

“Are you the one?” is free money

https://blog.owenlacey.dev/posts/are-you-the-one-is-free-money/
282•samwho•4d ago•56 comments

Native vs. emulation: World of Warcraft game performance on Snapdragon X Elite

https://rkblog.dev/posts/pc-hardware/pc-on-arm/x86_versus_arm_native_game/
53•geekman7473•7h ago•16 comments

Nature's many attempts to evolve a Nostr

https://newsletter.squishy.computer/p/natures-many-attempts-to-evolve-a
165•fiatjaf•5d ago•85 comments

Economics of Orbital vs. Terrestrial Data Centers

https://andrewmccalip.com/space-datacenters
84•flinner•9h ago•136 comments

Essential Semiconductor Physics [pdf]

https://nanohub.org/resources/43623/download/Essential_Semiconductor_Physics.pdf
160•akshatjiwan•2d ago•7 comments

Show HN: I designed my own 3D printer motherboard

https://github.com/KaiPereira/Cheetah-MX4-Mini
42•kaipereira•1w ago•10 comments

The Bob Dylan concert for just one person

https://www.flaggingdown.com/p/the-bob-dylan-concert-for-just-one
68•NaOH•6h ago•13 comments

Umbrel – Personal Cloud

https://umbrel.com
165•oldfuture•11h ago•93 comments

Rollstack (YC W23) is hiring multiple software engineers (TypeScript) US/Canada

https://www.ycombinator.com/companies/rollstack-2/jobs/QPqpb1n-software-engineer-typescript-us-ca...
1•yjallouli•5h ago

Canada's Carney called out for 'utilizing' British spelling

https://www.bbc.com/news/articles/cj69d89l8l5o
20•haunter•9h ago•33 comments

Light intensity steers molecular assemblies into 1D, 2D or 3D structures

https://phys.org/news/2025-11-intensity-molecular-1d-2d-3d.html
15•PaulHoule•5d ago•1 comments

A kernel bug froze my machine: Debugging an async-profiler deadlock

https://questdb.com/blog/async-profiler-kernel-bug/
82•bluestreak•10h ago•14 comments

Ford kills the All-Electric F-150

https://www.wired.com/story/ford-kills-electric-f-150-lightning-for-hybrid/
309•sacred-rat•9h ago•506 comments

In Defense of Matlab Code

https://runmat.org/blog/in-defense-of-matlab-whiteboard-style-code
103•finbarr1987•3d ago•115 comments

Chafa: Terminal Graphics for the 21st Century

https://hpjansson.org/chafa/
135•birdculture•12h ago•24 comments

Secret Documents Show Pepsi and Walmart Colluded to Raise Food Prices

https://www.thebignewsletter.com/p/secret-documents-show-pepsi-and-walmart
355•connor11528•9h ago•94 comments

John Updike wrote it all down

https://newrepublic.com/article/201598/john-updike-wrote
16•samclemens•6d ago•1 comments

Creating C closures from Lua closures

https://lowkpro.com/blog/creating-c-closures-from-lua-closures.html
4•publicdebates•4d ago•0 comments

Understanding carriage

https://seths.blog/2025/12/understanding-carriage/
35•herbertl•5d ago•9 comments

Cosmic-ray bath in a past supernova gives birth to Earth-like planets

https://www.science.org/doi/10.1126/sciadv.adx7892
91•toomuchtodo•14h ago•32 comments

We are discontinuing the dark web report

https://support.google.com/websearch/answer/16767242?hl=en
135•satertek•16h ago•41 comments

The appropriate amount of effort is zero

https://expandingawareness.org/blog/the-appropriate-amount-of-effort-is-zero/
91•gmays•10h ago•57 comments

Debugging TLS failures in distroless containers

https://lucabaggi.com/posts/ssl-docker/
13•asaiacai•5d ago•0 comments