frontpage.
newsnewestaskshowjobs

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.

Data Compression Explained

https://mattmahoney.net/dc/dce.html
38•mtdewcmu•3d ago•0 comments

Think of the children: How to force real ID for all internet traffic (2023)

https://nochan.net/b/Internet-Crap/20230829-Think-Of-The-Children/
170•Bender•8h ago•101 comments

There are no instances in ATProto

https://overreacted.io/there-are-no-instances-in-atproto/
372•danabramov•13h ago•207 comments

Surprising Economics of Load-Balanced Systems

https://brooker.co.za/blog/2020/08/06/erlang.html
65•KraftyOne•8h ago•18 comments

I used sound waves to make espresso

https://theconversation.com/i-used-sound-waves-to-make-espresso-it-could-cut-coffee-brewing-energ...
227•zeristor•6d ago•148 comments

Norway imposes near ban on AI in elementary school

https://www.reuters.com/technology/norway-imposes-near-ban-ai-elementary-school-2026-06-19/
524•ilreb•12h ago•356 comments

Hyundai buys Boston Dynamics

https://startupfortune.com/hyundai-takes-full-control-of-boston-dynamics-as-softbank-exits-for-32...
720•ck2•12h ago•330 comments

Bobby Prince, composer for Doom, Wolfenstein 3D, and Duke Nukem 3D, has died

https://www.legacy.com/legacy/robert-bobby-prince-lll
267•pgrote•9h ago•30 comments

Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

https://www.jvm-weekly.com/p/project-valhalla-explained-how-a
554•philonoist•22h ago•348 comments

How many of the 170k English words do you know?

https://vocabowl-870366514258.us-west1.run.app/
271•abnry•14h ago•389 comments

Hey, n00b, we didn't hire you to complete tasks

https://newsletter.kentbeck.com/p/hey-n00b-we-didnt-hire-you-to-complete
124•rrvsh•4h ago•55 comments

A Perceptron in Age of Empires II

https://adewynter.github.io/notes/aoe2-circuits
37•EvgeniyZh•1d ago•13 comments

Egyptian Fractions

https://blog.plover.com/math/egyptian-fractions.html
74•luu•4d ago•3 comments

How to feed a dictator

https://www.theguardian.com/film/2026/jun/09/how-to-feed-a-dictator-film
108•Michelangelo11•3h ago•37 comments

Meet Nikolai Evreinov, the 19th century Nathan Fielder

https://mssv.net/2026/06/16/meet-nikolai-evreinov-the-19th-century-nathan-fielder/
7•adrianhon•3d ago•0 comments

John Jumper to join Anthropic

https://twitter.com/JohnJumperSci/status/2068001285173834106
90•artninja1988•10h ago•61 comments

Telescope Ranchers

https://kottke.org/26/06/telescope-ranchers
109•bookofjoe•3d ago•43 comments

Big Banana Car

https://bigbananacar.com/
128•Bender•10h ago•73 comments

Court Records Should Be Free

https://www.eff.org/deeplinks/2026/06/court-records-should-be-free
296•hn_acker•11h ago•64 comments

The discovery that changed how scientists think about memory – IBM

https://www.ibm.com/think/news/discovery-changed-how-scientists-think-about-memory-kavli-prize
3•rbanffy•2d ago•0 comments

Ask HN: Will programmers write more efficient code during the memory shortage?

52•amichail•5h ago•87 comments

A 1976 university experiment spun up the U.S. wind industry

https://spectrum.ieee.org/william-heronemus-wind-energy
80•pseudolus•4d ago•8 comments

Zen and the Art of Machine Learning Research

https://blog.jxmo.io/p/zen-and-the-art-of-machine-learning
243•jxmorris12•4d ago•87 comments

RhinoCollab a plugin for real-time editing for Rhino 3D

https://rhinocollab.com
24•Ashxius•5d ago•5 comments

Building a robotics research setup that lives next to my desk

https://dfdxlabs.com/research/2026/robotics-setup/
127•mplappert•1d ago•43 comments

Show HN: Metiq: a real time 3D globe for 100 public datasets

https://metiq.space
97•rakeda•3d ago•30 comments

Zenzizenzizenzic

https://en.wikipedia.org/wiki/Zenzizenzizenzic
85•gyosifov•6h ago•23 comments

To study how chips work, MIT researchers built their own operating system

https://news.mit.edu/2026/to-study-how-chips-really-work-mit-researchers-built-their-own-operatin...
361•speckx•4d ago•55 comments

Ten years of ClickHouse in open source

https://clickhouse.com/blog/open-source-10
287•saisrirampur•4d ago•72 comments

The AirPods Effect

https://www.theescapenewsletter.com/p/the-airpods-effect
388•herbertl•1d ago•695 comments