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

Comments

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

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

Multiprocessing all the way!

emmelaich•8mo ago
(2021)

Good article!

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

Project Patchouli: Open-source electromagnetic drawing tablet hardware

https://patchouli.readthedocs.io/en/latest/
212•ffin•5h ago•17 comments

A closer look at a BGP anomaly in Venezuela

https://blog.cloudflare.com/bgp-route-leak-venezuela/
125•ChrisArchitect•4h ago•31 comments

The Napoleon Technique: Postponing Things to Increase Productivity

https://effectiviology.com/napoleon/
78•Khaine•3d ago•29 comments

Kernel bugs hide for 2 years on average. Some hide for 20

https://pebblebed.com/blog/kernel-bugs
171•kmavm•8h ago•66 comments

Open Infrastructure Map

https://openinframap.org
180•efskap•7h ago•35 comments

Eat Real Food

https://realfood.gov
852•atestu•17h ago•1155 comments

Lessons from Hash Table Merging

https://gist.github.com/attractivechaos/d2efc77cc1db56bbd5fc597987e73338
17•attractivechaos•5d ago•5 comments

Shipmap.org

https://www.shipmap.org/
620•surprisetalk•19h ago•99 comments

Go.sum is not a lockfile

https://words.filippo.io/gosum/
80•pabs3•6h ago•24 comments

Tailscale state file encryption no longer enabled by default

https://tailscale.com/changelog
293•traceroute66•14h ago•116 comments

Anyone have experiences with Audio Induction Loops?

https://en.wikipedia.org/wiki/Audio_induction_loop
10•evolve2k•3d ago•2 comments

ChatGPT Health

https://openai.com/index/introducing-chatgpt-health/
287•saikatsg•15h ago•340 comments

Play Aardwolf MUD

https://www.aardwolf.com/
131•caminanteblanco•11h ago•63 comments

The Q, K, V Matrices

https://arpitbhayani.me/blogs/qkv-matrices/
125•yashsngh•1d ago•53 comments

The virtual AmigaOS runtime (a.k.a. Wine for Amiga:)

https://github.com/cnvogelg/amitools/blob/main/docs/vamos.md
72•doener•10h ago•15 comments

LaTeX Coffee Stains (2021) [pdf]

https://ctan.math.illinois.edu/graphics/pgf/contrib/coffeestains/coffeestains-en.pdf
340•zahrevsky•20h ago•78 comments

GLSL Web CRT Shader

https://blog.gingerbeardman.com/2026/01/04/glsl-web-crt-shader/
60•msephton•3d ago•13 comments

AI misses nearly one-third of breast cancers, study finds

https://www.emjreviews.com/radiology/news/ai-misses-nearly-one-third-of-breast-cancers-study-finds/
91•Liquidity•4h ago•45 comments

Reading Without Limits or Expectations

https://www.carolinecrampton.com/reading-without-limits-or-expectations/
40•herbertl•2d ago•9 comments

Musashi: Motorola 680x0 emulator written in C

https://github.com/kstenerud/Musashi
69•doener•10h ago•7 comments

NPM to implement staged publishing after turbulent shift off classic tokens

https://socket.dev/blog/npm-to-implement-staged-publishing
172•feross•16h ago•55 comments

How Google got its groove back and edged ahead of OpenAI

https://www.wsj.com/tech/ai/google-ai-openai-gemini-chatgpt-b766e160
135•jbredeche•18h ago•148 comments

US will ban Wall Street investors from buying single-family homes

https://www.reuters.com/world/us/us-will-ban-large-institutional-investors-buying-single-family-h...
856•kpw94•15h ago•885 comments

Health care data breach affects over 600k patients, Illinois agency says

https://www.nprillinois.org/illinois/2026-01-06/health-care-data-breach-affects-600-000-patients-...
187•toomuchtodo•18h ago•66 comments

Show HN: Open database of link metadata for large-scale analysis

https://github.com/rumca-js/RSS-Link-Database-2025
5•renegat0x0•4d ago•1 comments

Notion AI: Unpatched data exfiltration

https://www.promptarmor.com/resources/notion-ai-unpatched-data-exfiltration
170•takira•15h ago•26 comments

Claude Code CLI was broken

https://github.com/anthropics/claude-code/issues/16673
128•sneilan1•14h ago•118 comments

A4 Paper Stories

https://susam.net/a4-paper-stories.html
349•blenderob•21h ago•159 comments

Creators of Tailwind laid off 75% of their engineering team

https://github.com/tailwindlabs/tailwindcss.com/pull/2388
1238•kevlened•18h ago•710 comments

“Stop Designing Languages. Write Libraries Instead” (2016)

https://lbstanza.org/purpose_of_programming_languages.html
246•teleforce•22h ago•241 comments