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

Comments

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

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

Multiprocessing all the way!

emmelaich•12mo ago
(2021)

Good article!

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

Async Rust never left the MVP state

https://tweedegolf.nl/en/blog/237/async-rust-never-left-the-mvp-state
225•pjmlp•4h ago•109 comments

Should I Run Plain Docker Compose in Production in 2026?

https://distr.sh/blog/running-docker-in-production/
84•pmig•4d ago•63 comments

When everyone has AI and the company still learns nothing

https://www.robert-glaser.de/when-everyone-has-ai-and-the-company-still-learns-nothing/
52•youngbrioche•2h ago•25 comments

Bun is being ported from Zig to Rust

https://github.com/oven-sh/bun/commit/46d3bc29f270fa881dd5730ef1549e88407701a5
571•SergeAx•10h ago•406 comments

Empty Screenings – Finds AMC movie screenings with few or no tickets sold

https://walzr.com/empty-screenings
176•MrBuddyCasino•7h ago•141 comments

Lessons for Agentic Coding: What should we do when code is cheap?

https://www.dbreunig.com/2026/05/04/10-lessons-for-agentic-coding.html
98•ingve•5h ago•74 comments

Hand Drawn QR Codes (2025)

https://sethmlarson.dev/hand-drawn-qr-codes
138•jollyjerry•8h ago•24 comments

Show HN: Got tired of paying $100/mo for SEO tools, so I built an alternative

https://idiotproofseo.com/
11•harryfelio•2h ago•5 comments

Google Chrome silently installs a 4 GB AI model on your device without consent

https://www.thatprivacyguy.com/blog/chrome-silent-nano-install/
361•john-doe•4h ago•380 comments

How OpenAI delivers low-latency voice AI at scale

https://openai.com/index/delivering-low-latency-voice-ai-at-scale/
420•Sean-Der•16h ago•131 comments

Farewell to a Giant of Botany

https://nautil.us/farewell-to-a-giant-of-botany-1280409
44•Brajeshwar•2d ago•0 comments

CVE-2026-31431: Copy Fail vs. rootless containers

https://www.dragonsreach.it/2026/05/04/cve-2026-31431-copy-fail-rootless-containers/
121•averi•8h ago•54 comments

Train Your Own LLM from Scratch

https://github.com/angelos-p/llm-from-scratch
291•kristianpaul•7h ago•32 comments

Agent Skills

https://addyosmani.com/blog/agent-skills/
280•BOOSTERHIDROGEN•14h ago•137 comments

How Many Children Learned Mathematics from Kiselev's Textbooks?

https://valeman.medium.com/how-many-children-learned-mathematics-from-kiselevs-textbooks-ff4efcea...
30•ibobev•22h ago•5 comments

The Frog for Whom the Bell Tolls

https://sethmlarson.dev/the-frog-for-whom-the-bell-tolls
20•anujbans•4h ago•6 comments

Why I Created phpc.tv

https://afilina.com/why-phpc-tv
29•luu•1d ago•5 comments

Mouse Pointer as a Mere Mortal

https://unsung.aresluna.org/mouse-pointer-as-a-mere-mortal/
36•zdw•2d ago•10 comments

Does Employment Slow Cognitive Decline? Evidence from Labor Market Shocks

https://www.nber.org/papers/w35117
307•littlexsparkee•20h ago•289 comments

Securing a DoD contractor: Finding a multi-tenant authorization vulnerability

https://www.strix.ai/blog/how-strix-found-zero-auth-vulnerability-dod-backed-startup
201•bearsyankees•18h ago•85 comments

Redis array: short story of a long development process

https://antirez.com/news/164
290•antirez•21h ago•105 comments

pgxbackup: Continuity Support for pgBackRest

https://thebuild.com/blog/2026/05/01/pgxbackup-continuity-support-for-pgbackrest/
59•Wingy•2d ago•10 comments

Biscuit

https://github.com/yattsu/biscuit
63•unixfg•8h ago•3 comments

Formatting a 25M-line codebase overnight

https://stripe.dev/blog/formatting-an-entire-25-million-line-codebase-overnight-the-rubyfmt-story
181•r00k•15h ago•90 comments

When networking doesn't work

https://www.os2museum.com/wp/when-networking-doesnt-work/
72•kencausey•15h ago•11 comments

Talking to strangers at the gym

https://thienantran.com/talking-to-35-strangers-at-the-gym/
1391•thitran•1d ago•661 comments

Kids bypass age verification with fake moustaches

https://www.theregister.com/2026/05/04/uk_online_safety_act_age_checks_subvert/
133•dreadsword•7h ago•96 comments

2-D Mathematical Curves

https://www.2dcurves.com/
41•the-mitr•7h ago•2 comments

Setting up server monitoring for a Rails app on Hatchbox

https://blog.appsignal.com/2026/04/30/setting-up-server-monitoring-for-a-rails-app-on-hatchbox.html
6•andreigaspar•1d ago•1 comments

Gap between national food production and food-based dietary guidance (2025)

https://www.nature.com/articles/s43016-025-01173-4
68•simonebrunozzi•23h ago•52 comments