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.

Flipper One – we need your help

https://blog.flipper.net/flipper-one-we-need-your-help/
668•sandebert•5h ago•306 comments

Python 3.15: features that didn't make the headlines

https://blog.changs.co.uk/python-315-features-that-didnt-make-the-headlines.html
199•rbanffy•5h ago•85 comments

Indexing a year of video locally on a 2021 MacBook with Gemma4-31B (50GB swap)

https://blog.simbastack.com/indexed-a-year-of-video-locally/
62•asenna•2h ago•20 comments

Michael Keating has died

https://www.bigfinish.com/news/v/michael-keating-1947-2026
43•speckx•2h ago•25 comments

We're testing new ad formats in Search and expanding our Direct Offers pilot

https://blog.google/products/ads-commerce/google-marketing-live-search-ads/
446•sofumel•6h ago•372 comments

Lost Images from the 1945 Trinity Nuclear Test Restored

https://spectrum.ieee.org/trinity-nuclear-test
136•pseudolus•5h ago•46 comments

Mounting Git commits as folders with NFS

https://jvns.ca/blog/2023/12/04/mounting-git-commits-as-folders-with-nfs/
27•pvtmert•2d ago•8 comments

Launch HN: Runtime (YC P26) – Sandboxed coding agents for everyone on a team

https://www.runtm.com/
7•gustrigos•25m ago•0 comments

Who Wins and Who Loses in Prediction Markets? Evidence from Polymarket

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6443103
74•vcf•3h ago•47 comments

FatGid: FreeBSD 14.x kernel local privilege escalation

https://fatgid.io/
49•WhyNotHugo•4h ago•13 comments

Google's Antigravity Bait and Switch

https://www.0xsid.com/blog/antigravity-bait-n-switch
259•ssiddharth•2h ago•137 comments

Get your passwords out of Bitwarden while you still can

https://www.osnews.com/story/145029/get-your-passwords-out-of-bitwarden-while-you-still-can/
118•speckx•2h ago•74 comments

Vivaldi 8.0

https://vivaldi.com/blog/vivaldi-on-desktop-8-0/
214•OuterVale•9h ago•148 comments

AI is just unauthorised plagiarism at a bigger scale

https://axelk.ee/ai-is-just-unauthorised-plagiarism-at-a-bigger-scale/
536•speckx•2h ago•400 comments

Cekura (YC F24) Is Hiring

https://www.ycombinator.com/companies/cekura-ai/jobs/AiWwUxI-forward-deployed-engineer-us
1•atarus•4h ago

Show HN: I Dedicated 4 Years to Mastering Offline Password Cracking

64•bojta-lepenye•3h ago•4 comments

Show HN: Rmux – A programmable terminal multiplexer with a Playwright-style SDK

https://github.com/helvesec/rmux
137•shideneyu•7h ago•66 comments

We Reverse-Engineered Docker Sandbox's Undocumented MicroVM API

https://rivet.dev/blog/2026-02-04-we-reverse-engineered-docker-sandbox-undocumented-microvm-api/
15•yakkomajuri•1h ago•0 comments

A Bipartisan Amendment Would End Police License Plate Tracking Nationwide

https://www.wired.com/story/a-bipartisan-amendment-would-end-police-license-plate-tracking-nation...
110•cdrnsf•3h ago•20 comments

IBM invented semiconductor manufacturing automation

https://spectrum.ieee.org/semiconductor-fabrication
46•rbanffy•5h ago•1 comments

What Do Gödel's Incompleteness Theorems Mean?

https://www.quantamagazine.org/what-do-godels-incompleteness-theorems-truly-mean-20260518/
78•baruchel•2d ago•31 comments

Show HN: I reverse engineered Apple's video wallpapers

https://github.com/kageroumado/phosphene
372•kageroumado•16h ago•91 comments

Flipper One Tech Specs

https://docs.flipper.net/one/general/tech-specs
484•gregsadetsky•21h ago•160 comments

No Slop Grenade

https://noslopgrenade.com/
265•napolux•7h ago•161 comments

The Letter S, by Donald Knuth (1980) [pdf]

https://gwern.net/doc/design/typography/1980-knuth.pdf
241•bambax•16h ago•43 comments

The Palomar Lights

https://comics.phillyharper.com/
25•tardismechanic•2d ago•12 comments

An OpenAI model has disproved a central conjecture in discrete geometry

https://openai.com/index/model-disproves-discrete-geometry-conjecture/
1324•tedsanders•21h ago•959 comments

Haskell Foundation 2026 Update

https://discourse.haskell.org/t/haskell-foundation-2026-update/14136
160•azhenley•14h ago•57 comments

DOS Zone

https://dos.zone/
320•rglover•17h ago•73 comments

GitHub confirms breach of 3,800 repos via malicious VSCode extension

https://www.bleepingcomputer.com/news/security/github-confirms-breach-of-3-800-repos-via-maliciou...
983•Timofeibu•1d ago•429 comments