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.

A “frozen” dictionary for Python

https://lwn.net/SubscriberLink/1047238/25c270b077849dc0/
91•jwilk•4h ago•58 comments

Size of Life

https://neal.fun/size-of-life/
2195•eatonphil•21h ago•243 comments

Show HN: Local Privacy Firewall-blocks PII and secrets before ChatGPT sees them

https://github.com/privacyshield-ai/privacy-firewall
25•arnabkarsarkar•1d ago•4 comments

Meta shuts down global accounts linked to abortion advice and queer content

https://www.theguardian.com/global-development/2025/dec/11/meta-shuts-down-global-accounts-linked...
216•ta988•2h ago•135 comments

South Korea – A Cautionary Tale for the Rest of Humanity

https://worksinprogress.co/issue/two-is-already-too-many/
18•barry-cotter•1h ago•23 comments

The Cost of a Closure in C

https://thephd.dev/the-cost-of-a-closure-in-c-c2y
105•ingve•6h ago•34 comments

Getting a Gemini API key is an exercise in frustration

https://ankursethi.com/blog/gemini-api-key-frustration/
626•speckx•17h ago•251 comments

Australia begins enforcing world-first teen social media ban

https://www.reuters.com/legal/litigation/australia-social-media-ban-takes-effect-world-first-2025...
843•chirau•1d ago•1273 comments

Patterns.dev

https://www.patterns.dev/
369•handfuloflight•12h ago•85 comments

Helldivers 2 on-disk size 85% reduction

https://store.steampowered.com/news/app/553850/view/491583942944621371
78•SergeAx•1w ago•57 comments

Show HN: oeis-tui – A TUI to search OEIS integer sequences in the terminal

https://github.com/hako/oeis-tui
11•wesleyhill•1w ago•0 comments

Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program

https://serversfor.dev/linux-inside-out/the-linux-kernel-is-just-a-program/
167•birdculture•6d ago•50 comments

French supermarket's Christmas advert is worldwide hit (without AI) [video]

https://www.youtube.com/watch?v=Na9VmMNJvsA
17•gbugniot•20m ago•3 comments

How the Brain Parses Language

https://www.quantamagazine.org/the-polyglot-neuroscientist-resolving-how-the-brain-parses-languag...
49•mylifeandtimes•3d ago•17 comments

Auto-grading decade-old Hacker News discussions with hindsight

https://karpathy.bearblog.dev/auto-grade-hn/
478•__rito__•20h ago•214 comments

How can I read the standard output of an already-running process?

https://devblogs.microsoft.com/oldnewthing/20251204-00/?p=111841
10•ibobev•5d ago•2 comments

Python Workers redux: fast cold starts, packages, and a uv-first workflow

https://blog.cloudflare.com/python-workers-advancements/
82•dom96•2d ago•32 comments

How Google Maps allocates survival across London's restaurants

https://laurenleek.substack.com/p/how-google-maps-quietly-allocates
312•justincormack•2d ago•156 comments

Go's escape analysis and why my function return worked

https://bonniesimon.in/blog/go-escape-analysis
24•bonniesimon•6d ago•15 comments

VCMI: An open-source engine for Heroes III

https://vcmi.eu/
132•eamag•4d ago•15 comments

Rubio stages font coup: Times New Roman ousts Calibri

https://www.reuters.com/world/us/rubio-stages-font-coup-times-new-roman-ousts-calibri-2025-12-09/
323•italophil•1d ago•536 comments

Super Mario 64 for the PS1

https://github.com/malucard/sm64-psx
253•LaserDiscMan•18h ago•98 comments

Show HN: Wirebrowser – A JavaScript debugger with breakpoint-driven heap search

https://github.com/fcavallarin/wirebrowser
47•fcavallarin•23h ago•10 comments

Why No Fish Wants a Tongue-Eating Parasitic Louse in Its Mouth

https://animals.howstuffworks.com/marine-life/parasitic-tongue-eating-louse.htm
5•thunderbong•28m ago•0 comments

Qwen3-Omni-Flash-2025-12-01:a next-generation native multimodal large model

https://qwen.ai/blog?id=qwen3-omni-flash-20251201
282•pretext•21h ago•95 comments

Incomplete list of mistakes in the design of CSS

https://wiki.csswg.org/ideas/mistakes
145•OuterVale•9h ago•95 comments

Flow Where You Want – Guidance for Flow Models

https://drscotthawley.github.io/blog/posts/FlowWhereYouWant.html
28•rundigen12•5d ago•1 comments

Show HN: Automated license plate reader coverage in the USA

https://alpranalysis.com
200•sodality2•20h ago•117 comments

Fossils reveal anacondas have been giants for over 12 million years

https://www.cam.ac.uk/stories/twelve-million-years-of-giant-anacondas
57•ashishgupta2209•1w ago•26 comments

Why Startups Die

https://www.techfounderstack.com/p/why-startups-die
60•makle•3d ago•40 comments