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

Comments

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

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

Multiprocessing all the way!

emmelaich•11mo ago
(2021)

Good article!

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

Belgium stops decommissioning nuclear power plants

https://dpa-international.com/general-news/urn:newsml:dpa.com:20090101:260430-930-14717/
454•mpweiher•4h ago•365 comments

Meta in row after workers who saw smart glasses users having sex lose jobs

https://www.bbc.com/news/articles/c5y7yvgy0w6o
380•gorbachev•3h ago•265 comments

How an Oil Refinery Works

https://www.construction-physics.com/p/how-an-oil-refinery-works
121•chmaynard•2h ago•22 comments

Spain's parliament will act against massive IP blockages by LaLiga

https://www.democrata.es/en/politics/congress-and-senate/congress-will-act-against-massive-ip-blo...
19•akyuu•49m ago•2 comments

I aggregated 28 US Government auction sites into one search

https://bidprowl.com
140•scarsam•3h ago•42 comments

You can beat the binary search

https://lemire.me/blog/2026/04/27/you-can-beat-the-binary-search/
83•vok•2d ago•43 comments

Granite 4.1: IBM's 8B Model Matching 32B MoE

https://firethering.com/granite-4-1-ibm-open-source-model-family/
216•steveharing1•5h ago•128 comments

Mozilla's Opposition to Chrome's Prompt API

https://github.com/mozilla/standards-positions/issues/1213
386•jaffathecake•8h ago•157 comments

The FCC is about to ban 21% of its test labs today. I mapped them all

https://markready.io/blog/fcc-accredited-test-labs-complete-guide
111•chambertime•2h ago•59 comments

Durable queues, streams, pub/sub, and a cron scheduler – inside your SQLite file

https://honker.dev/
12•ferriswil•1h ago•0 comments

The Zig project's rationale for their anti-AI contribution policy

https://simonwillison.net/2026/Apr/30/zig-anti-ai/
534•lumpa•14h ago•291 comments

Noctua releases official 3D CAD models for its cooling fans

https://www.noctua.at/en/3d-cad-models
415•embedding-shape•2d ago•94 comments

Where the goblins came from

https://openai.com/index/where-the-goblins-came-from/
914•ilreb•13h ago•541 comments

Claude Code refuses requests or charges extra if your commits mention "OpenClaw"

https://twitter.com/theo/status/2049645973350363168
139•elmean•1h ago•84 comments

Copy Fail

https://copy.fail/
1267•unsnap_biceps•22h ago•450 comments

Because It Doesn't Have To

https://blog.computationalcomplexity.org/2026/04/because-it-doesnt-have-to.html
9•zdw•23h ago•0 comments

A Primer on Bézier Curves – So What Makes a Bézier Curve?

https://pomax.github.io/bezierinfo/
72•mostlyk•2d ago•18 comments

My Stratum-0 Atomic Clock

https://coverclock.blogspot.com/2017/05/my-stratum-0-atomic-clock_9.html
44•g0xA52A2A•2d ago•12 comments

Japan Is Building Cardboard Suicide Drones

https://www.404media.co/japan-cardboard-drones-air-kamuy/
49•Brajeshwar•1h ago•34 comments

Craig Venter has died

https://www.jcvi.org/media-center/j-craig-venter-genomics-pioneer-and-founder-jcvi-and-diploid-ge...
298•rdl•14h ago•74 comments

The Science Behind Honey's Eternal Shelf Life (2013)

https://www.smithsonianmag.com/science-nature/the-science-behind-honeys-eternal-shelf-life-1218690/
22•downbad_•3h ago•15 comments

GCC 16 has been released

https://gcc.gnu.org/gcc-16/changes.html
204•HeliumHydride•4h ago•36 comments

Show HN: FusionCore: ROS 2 sensor fusion that outperforms robot_localization

https://github.com/manankharwar/fusioncore
4•kharwarm•2d ago•0 comments

"Parse, don't validate" through the years with C++

https://derekrodriguez.dev/parse-dont-validate-through-the-years-with-c-/
63•dwrodri•3d ago•31 comments

DataCenter.FM – background noise app featuring the sound of the AI bubble

https://datacenter.fm/
98•louisbarclay•8h ago•21 comments

Show HN: I wrote a DOOM clone in my own programming language

https://spectrelang.org/log/devlog#cubedoom
24•pizza_man•2d ago•12 comments

Biology is a Burrito: A text- and visual-based journey through a living cell

https://burrito.bio/essays/biology-is-a-burrito
168•the-mitr•12h ago•23 comments

Zed 1.0

https://zed.dev/blog/zed-1-0
2015•salkahfi•1d ago•655 comments

FastCGI: 30 years old and still the better protocol for reverse proxies

https://www.agwa.name/blog/post/fastcgi_is_the_better_protocol_for_reverse_proxies
398•agwa•1d ago•97 comments

OpenTrafficMap

https://opentrafficmap.org/
350•moooo99•20h ago•92 comments