frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

How async/await works in Python (2021)

https://tenthousandmeters.com/blog/python-behind-the-scenes-12-how-asyncawait-works-in-python/
58•sebg•9h ago

Comments

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

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

Multiprocessing all the way!

emmelaich•7h ago
(2021)

Good article!

punnerud•6h 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•5h 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•4h ago
How does the GIL come into play here?
punnerud•4h 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.

ALICE detects the conversion of lead into gold at the LHC

https://www.home.cern/news/news/physics/alice-detects-conversion-lead-gold-lhc
346•miiiiiike•5h ago•192 comments

Launch HN: Nao Labs (YC X25) – Cursor for Data

66•ClaireGz•3h ago•34 comments

Inventing the Adventure Game (1984)

http://www.warrenrobinett.com/inventing_adventure/
19•CaesarA•1h ago•1 comments

Past, present, and future of Sorbet type syntax

https://blog.jez.io/history-of-sorbet-syntax/
79•PaulHoule•3h ago•32 comments

Sofie: open-source web based system for automating live TV news production

https://nrkno.github.io/sofie-core/
206•rjmunro•6h ago•28 comments

21 GB/s CSV Parsing Using SIMD on AMD 9950X

https://nietras.com/2025/05/09/sep-0-10-0/
195•zigzag312•6h ago•85 comments

In the Network of the Conclav: How we "guessed" the Pope using network science

https://www.unibocconi.it/en/news/network-conclave
66•taubek•2h ago•41 comments

Why 536 was 'the worst year to be alive'

https://www.science.org/content/article/why-536-was-worst-year-be-alive
11•Jimmc414•48m ago•0 comments

New Tool: lsds – List All Linux Block Devices and Settings in One Place

https://tanelpoder.com/posts/lsds-list-linux-block-devices-and-their-config/
30•mfiguiere•1h ago•3 comments

Show HN: Oliphaunt – A native Mastodon client for macOS

https://testflight.apple.com/join/Epq1P3Cw
47•anosidium•3h ago•14 comments

Itter.sh – Micro-Blogging via Terminal

https://www.itter.sh/
130•rrr_oh_man•5h ago•38 comments

Rollstack (YC W23) Is Hiring TypeScript Engineers (Remote US/CA)

https://www.ycombinator.com/companies/rollstack-2/jobs/QPqpb1n-software-engineer-typescript-us-canada
1•yjallouli•2h ago

Show HN: Aberdeen – An elegant approach to reactive UIs

https://aberdeenjs.org/
151•vanviegen•7h ago•82 comments

Show HN: A backend agnostic Ruby framework for building reactive desktop apps

https://codeberg.org/skinnyjames/hokusai
44•zero-st4rs•3h ago•18 comments

LegoGPT: Generating Physically Stable and Buildable Lego

https://avalovelace1.github.io/LegoGPT/
520•nkko•15h ago•134 comments

Show HN: BlenderQ – A TUI for managing multiple Blender renders

https://github.com/KyleTryon/BlenderQ
33•TechSquidTV•3h ago•3 comments

Show HN: Hyvector – A fast and modern SVG editor

https://www.hyvector.com
213•jansan•9h ago•45 comments

Cell Mates: Extracting Useful Information from Tables for LLMs

https://www.gojiberries.io/cell-mates-extracting-useful-information-from-tables-for-llms/
17•goji_berries•2d ago•1 comments

Reverse Engineering "DNA Sequences" in the Lost World: Jurassic Park Video Game

https://32bits.substack.com/p/under-the-microscope-the-lost-world
10•bbayles•2d ago•0 comments

CryptPad: An Alternative to the Google Suite

https://cryptpad.org/
115•ColinWright•8h ago•30 comments

Data manipulations alleged in study that paved way for Microsoft's quantum chip

https://www.science.org/content/article/data-manipulations-alleged-study-paved-way-microsoft-s-quantum-chip
164•EvgeniyZh•8h ago•119 comments

The birth of AI poker? Letters from the 1984 WSOP

https://www.poker.org/latest-news/the-birth-of-ai-poker-letters-from-the-1984-wsop-a4v2W4N4X3EP/
35•indigodaddy•4d ago•7 comments

NSF faces shake-up as officials abolish its 37 divisions

https://www.science.org/content/article/exclusive-nsf-faces-radical-shake-officials-abolish-its-37-divisions
340•magicalist•7h ago•438 comments

The Anarchitecture Group

https://www.spatialagency.net/database/the.anarchitecture.group
20•jruohonen•3h ago•3 comments

Implementing a Struct of Arrays

https://brevzin.github.io/c++/2025/05/02/soa/
100•mpweiher•9h ago•34 comments

Show HN: Agents.erl (AI Agents in Erlang)

https://github.com/arthurcolle/agents.erl
24•arthurcolle•2d ago•14 comments

The CL1: the first code deployable biological computer

https://corticallabs.com/cl1.html
30•sprawl_•2d ago•14 comments

A Taxonomy for Rendering Engines

https://c0de517e.com/021_taxonomy.htm
38•ibobev•3d ago•13 comments

Hollow Core Fiber (HCF)

https://www.holightoptic.com/what-is-hollow-core-fiber-hcf%ef%bc%9f/
47•giuliomagnifico•6h ago•22 comments

The Linux Kernel's PGP Web of Trust

https://blog.kleine-koenig.org/ukl/the-linux-kernels-pgp-web-of-trust.html
70•JNRowe•9h ago•11 comments