frontpage.
newsnewestaskshowjobs

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.

Noise infusion banned from statistical products published by Census Bureau

https://desfontain.es/blog/banning-noise.html
749•nl•12h ago•472 comments

GLM 5.2 Is Out

https://twitter.com/jietang/status/2065784751345287314
379•aloknnikhil•10h ago•211 comments

Every Frame Perfect

https://tonsky.me/blog/every-frame-perfect/
582•ravenical•14h ago•192 comments

Pyodide 314.0: Python packages can now publish WebAssembly wheels to PyPI

https://blog.pyodide.org/posts/314-release/
89•agriyakhetarpal•4d ago•16 comments

Treating pancreatic tumours may have revealed cancer's master switch

https://economist.com/science-and-technology/2026/06/12/treating-pancreatic-tumours-may-have-reve...
308•andsoitis•13h ago•109 comments

FreeOberon – Open-Source, Cross-Platform, Free Pascal/Turbo Pascal-Like Language

https://github.com/kekcleader/FreeOberon
25•peter_d_sherman•2d ago•9 comments

10th Gen Honda Civic Updates Are Signed with AOSP Test Keys

https://juniperspring.org/posts/honda-evil-valet/
30•librick•1h ago•5 comments

'Tell Him He's a Piece of Shit': Meta's New AI Unit Is a Total Mess

https://www.wired.com/story/mark-zuckerberg-meta-employee-meeting-interrupt-ai/
44•momentmaker•1h ago•32 comments

A whale necropolis has been found

https://www.nature.com/articles/d41586-026-01581-x
18•tigerlily•3d ago•2 comments

ReactOS (FOSS "Windows") achieves 3D-accelerated Half-Life on real hardware

https://www.phoronix.com/news/ReactOS-Running-Half-Life
103•jeditobe•3h ago•14 comments

4 things to know about the new sunscreen ingredient the FDA approved

https://www.npr.org/2026/06/13/nx-s1-5856385/sunscreen-skin-protection-bemotrizinol
40•mikhael•1h ago•3 comments

Running DOS on Behringers DDX3216 with a DIY x86-Bios from Scratch

https://chrisdevblog.com/2026/06/08/running-dos-on-behringers-ddx3216-using-a-diy-x86-bios/
80•rasz•8h ago•17 comments

Amazon CEO's talks with U.S. officials triggered crackdown on Anthropic models

https://www.wsj.com/tech/ai/amazon-ceos-talks-with-u-s-officials-triggered-crackdown-on-anthropic...
559•ls612•9h ago•407 comments

Codex for open source

https://openai.com/form/codex-for-oss/
178•EvgeniyZh•2d ago•51 comments

GameBoy Workboy

https://tcrf.net/Workboy
163•tosh•8h ago•54 comments

Police officer investigated for using AI to 'create evidence' in multiple cases

https://news.sky.com/story/derbyshire-police-officer-investigated-for-using-ai-to-create-evidence...
239•austinallegro•6h ago•110 comments

Ancient genome duplications laid the foundations of complex brains

https://www.ox.ac.uk/news/2026-06-09-ancient-genome-duplications-laid-the-foundations-of-complex-...
19•hhs•3h ago•1 comments

A low-carbon computing platform from your retired phones

https://research.google/blog/a-low-carbon-computing-platform-from-your-retired-phones/
252•vikas-sharma•16h ago•135 comments

Human Routers of Machine Words

https://borretti.me/article/human-routers-of-machine-words
31•zx321•5h ago•16 comments

Appreciating Exif

https://brentfitzgerald.com/posts/appreciating-exif/
134•burnto•4d ago•29 comments

The adder at the heart of Intel's 8087 floating-point chip

https://www.righto.com/2026/06/intel-8087-adder-reverse-engineered.html
94•pwg•9h ago•25 comments

Resurrecting a soaked, corroded, and damaged Commodore SX‑64 (2025)

https://jerrylparker.com/blogs/posts/sx-64.html
20•hggh•2d ago•3 comments

The experience of rendering Arabic typography and its technical debt

https://lr0.org/blog/p/arabic/
197•bookofjoe•13h ago•46 comments

RTX 5080 and RTX 3090 Setup: 80 Tok/s on Qwen 3.6 27B Q8

https://imil.net/blog/posts/2026/rtx-5080-+-rtx-3090-setup-80+-tok-s-on-qwen-3.6-27b-q8/
196•iMil•16h ago•68 comments

Orthodox C++ (2016)

https://bkaradzic.github.io/posts/orthodoxc++/
86•signa11•12h ago•147 comments

AI coding at home without going broke

https://stephen.bochinski.dev/blog/2026/06/13/ai-coding-at-home-without-going-broke/
240•sbochins•9h ago•214 comments

AI OSS tool repo goes archived over night after raising $7.3M Seed

https://github.com/tensorzero/tensorzero
244•hek2sch•14h ago•160 comments

State Attorneys General Are Investigating OpenAI

https://www.nytimes.com/2026/06/13/technology/states-investigating-openai.html
39•donohoe•2h ago•3 comments

Israeli firm BlackCore suspected of meddling in New York and Scotland votes

https://www.reuters.com/world/israeli-firm-blackcore-also-suspected-meddling-nyc-scotland-votes-f...
576•pera•18h ago•334 comments

The state of building user interfaces in Rust

https://areweguiyet.com/#ecosystem
177•mahirsaid•3d ago•117 comments