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.

DynIP – Dynamic DNS with RFC 2136, IPv6, DNSSEC, and BYOD

https://dynip.dev/
75•dynip•1h ago•20 comments

Using AI to write better code more slowly

https://nolanlawson.com/2026/05/25/using-ai-to-write-better-code-more-slowly/
620•signa11•10h ago•236 comments

Taking a walk may lead to more creativity than sitting, study finds (2014)

https://www.apa.org/news/press/releases/2014/04/creativity-walk
280•bilsbie•10h ago•95 comments

Use Boring Languages with LLMs

https://jry.io/writing/use-boring-languages-with-llms/
32•evakhoury•3d ago•18 comments

Earthion: A New Mega Drive-Style Shoot-Em-Up

https://earthiongame.com/
63•MrBuddyCasino•5h ago•24 comments

How Shamir's Secret Sharing Works

https://ente.com/blog/how-shamirs-secret-sharing-works/
192•subract•10h ago•31 comments

Ferrari Luce

https://www.ferrari.com/en-EN/auto/ferrari-luce
236•jumploops•12h ago•472 comments

A successful Japanese trial of a ramjet engine designed for Mach‑5 aircraft

https://www.bgr.com/2178211/japan-hypersonic-engine-ramjet-2-hour-flights-to-us/
151•rmason•13h ago•115 comments

Exit IP VPN servers mitigation rollout

https://mullvad.net/en/help/exit-ip-vpn-servers-mitigation-rollout
356•Cider9986•15h ago•65 comments

The User Is Visibly Frustrated

https://pscanf.com/s/354/
137•croes•4h ago•110 comments

Norway's 2 petabytes of Huawei flash storage and LLM training

https://www.blocksandfiles.com/flash/2026/05/22/norways-2-petabytes-of-huawei-flash-storage-and-l...
265•rbanffy•13h ago•169 comments

Dehydration's role in learning and memory

https://www.cshl.edu/dehydrations-role-in-learning-and-memory/
54•hhs•3d ago•34 comments

Toshifumi Suzuki, founder of Seven-Eleven Japan, has died

https://www.referenceforbusiness.com/biography/S-Z/Suzuki-Toshifumi-1932.html
197•L_Rahman•16h ago•84 comments

Motorola phones have started hijacking the Amazon app to insert affiliate codes

https://9to5google.com/2026/05/25/motorola-amazon-app-hijacking-behavior/
134•Cider9986•5h ago•72 comments

What we lost when we stopped letting kids leave the front yard

https://stevemagness.substack.com/p/the-cost-of-safetyism
212•obscurette•18h ago•190 comments

California moves to exempt Linux from its age-verification law after backlash

https://www.tomshardware.com/software/linux/california-moves-to-exempt-linux-from-its-upcoming-ag...
865•rbanffy•14h ago•380 comments

Micropatching Brings the Abandoned Equation Editor Back to Life (2018)

https://blog.0patch.com/2018/01/bringing-abandoned-equation-editor-back.html
24•bariumbitmap•4d ago•6 comments

Performance of Rust Language [pdf]

https://github.com/yugr/rust-slides/
73•tanelpoder•9h ago•44 comments

You Only Use 10% of Printf() – Here Are Things They Didn't Teach You [video]

https://www.youtube.com/watch?v=kdnN0kk7MS0
16•bwidlar•3d ago•6 comments

Squares in Squares

https://kingbird.myphotos.cc/packing/squares_in_squares.html
70•carlos-menezes•1d ago•8 comments

Ask HN: Is anyone working at least 4 hours daily on an Apple Vision Pro?

100•widenrun•3h ago•63 comments

Show HN: Write your BPF programs in Go, not C

https://github.com/boratanrikulu/gobee
86•boratanrikulu•4d ago•39 comments

Hacker News front page as a site

https://thefrontpage.dev/
251•thatxliner•13h ago•70 comments

Magnifica Humanitas

https://www.vatican.va/content/leo-xiv/en/encyclicals/documents/20260515-magnifica-humanitas.html
1422•theletterf•23h ago•801 comments

Show HN: OpenBrief – Local-first video downloader/summarizer

https://github.com/tantara/openbrief
61•tantara•11h ago•10 comments

Nobody cracks open a programming book anymore

https://unix.foo/posts/nobody-cracks-open-a-programming-book/
193•zdw•9h ago•226 comments

Jensen–Shannon Divergence

https://en.wikipedia.org/wiki/Jensen%E2%80%93Shannon_divergence
110•teleforce•3d ago•17 comments

What it takes to transpose a matrix

https://gudok.xyz/transpose/
55•tosh•1d ago•3 comments

Logseq Doctor: Heal your flat old Markdown files before importing them to Logseq

https://github.com/andreoliwa/logseq-doctor
7•ankitg12•3h ago•1 comments

Does anybody like React?

https://jsx.lol
181•brazukadev•7h ago•230 comments