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.

About 10% of AMC movie showings sell zero tickets. This site finds them

https://walzr.com/empty-screenings
81•MrBuddyCasino•1h ago•51 comments

What I'm Hearing About Cognitive Debt (So Far)

https://margaretstorey.com/blog/2026/02/18/cognitive-debt-revisited/
158•raphaelcosta•3h ago•77 comments

Bun is being ported from Zig to Rust

https://github.com/oven-sh/bun/commit/46d3bc29f270fa881dd5730ef1549e88407701a5
360•SergeAx•4h ago•236 comments

Train Your Own LLM from Scratch

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

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

https://www.dragonsreach.it/2026/05/04/cve-2026-31431-copy-fail-rootless-containers/
58•averi•2h ago•15 comments

Pulitzer Prize Winner in International Reporting

https://www.pulitzer.org/winners/dake-kang-garance-burke-byron-tau-aniruddha-ghosal-and-yael-grau...
66•jay_kyburz•3h ago•3 comments

How OpenAI delivers low-latency voice AI at scale

https://openai.com/index/delivering-low-latency-voice-ai-at-scale/
361•Sean-Der•10h ago•117 comments

The Car That Watches You Back: The Advertising Infrastructure of Modern Cars

https://nobodyaskedforthis.lol/posts/connected-car/
50•cadito•4h ago•29 comments

Agent Skills

https://addyosmani.com/blog/agent-skills/
200•BOOSTERHIDROGEN•8h ago•87 comments

Hand Drawn QR Codes

https://sethmlarson.dev/hand-drawn-qr-codes
12•jollyjerry•2h ago•0 comments

Gaps in national food production, worldwide

https://www.nature.com/articles/s43016-025-01173-4
36•simonebrunozzi•17h ago•14 comments

When Networking Doesn't Work

https://www.os2museum.com/wp/when-networking-doesnt-work/
46•kencausey•9h ago•6 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
190•bearsyankees•12h ago•79 comments

Does Employment Slow Cognitive Decline? Evidence from Labor Market Shocks

https://www.nber.org/papers/w35117
260•littlexsparkee•14h ago•237 comments

pgxbackup: Continuity Support for pgBackRest

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

Redis array: short story of a long development process

https://antirez.com/news/164
262•antirez•15h ago•87 comments

Testing macOS on the Apple Network Server 2.0 ROMs

http://oldvcr.blogspot.com/2026/05/testing-macos-on-apple-network-server.html
78•zdw•1d ago•15 comments

Talking to strangers at the gym

https://thienantran.com/talking-to-35-strangers-at-the-gym/
1284•thitran•18h ago•604 comments

1966 Ford Mustang Converted into a Tesla with Working 'Full Self-Driving'

https://electrek.co/2026/05/02/tesla-1966-mustang-ev-conversion-full-self-driving/
160•Brajeshwar•14h ago•115 comments

Microsoft Edge stores all passwords in memory in clear text, even when unused

https://twitter.com/L1v1ng0ffTh3L4N/status/2051308329880719730
489•cft•11h ago•176 comments

2-D Mathematical Curves

https://www.2dcurves.com/
5•the-mitr•1h ago•0 comments

Y Combinator's Stake in OpenAI (0.6%)

https://daringfireball.net/2026/05/y_combinators_stake_in_openai
248•gyomu•5h ago•26 comments

I am worried about Bun

https://wwj.dev/posts/i-am-worried-about-bun/
458•remote-dev•13h ago•308 comments

How Monero’s proof of work works

https://blog.alcazarsec.com/tech/posts/how-moneros-proof-of-work-works
268•alcazar•15h ago•190 comments

PyInfra 3.8.0

https://github.com/pyinfra-dev/pyinfra/releases/tag/v3.8.0
252•wowi42•17h ago•88 comments

Pomiferous: The most extensive apples (pommes) database

https://pomiferous.com/
115•Ariarule•15h ago•47 comments

Kids bypass age verification with fake moustaches

https://www.theregister.com/2026/05/04/uk_online_safety_act_age_checks_subvert/
19•dreadsword•1h ago•1 comments

GameStop makes $55.5B takeover offer for eBay

https://www.bbc.co.uk/news/articles/cn0p8yled1do
667•n1b0m•20h ago•635 comments

18th-century mechanical volcano roars to life 250 years later

https://www.sciencedaily.com/releases/2026/05/260502015359.htm
7•samizdis•2d ago•1 comments

Formatting a 25M-line codebase overnight

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