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.

NVIDIA Announces CEO Transition

https://nvidianews.nvidia.com/news/nvidia-announces-ceo-transition
573•lldb•47m ago•415 comments

Why Writing Correct Software Is Hard

https://pron.github.io/posts/correctness-and-complexity
180•AriFordsham•4h ago•75 comments

Jensen Huang resigns as Nvidia CEO immediately

https://www.reuters.com/live/nvidia-live-board-meets-fate-ceo-jensen-huang-after-affair-reports-2...
153•ksec•43m ago•52 comments

Abandoned Quake 4 expansion finished by modders and now playable

https://www.moddb.com/mods/openq4/downloads/openq4-0141-windows-x64
6•klaussilveira•21m ago•0 comments

Jane Street: Socratic Tutor

https://github.com/janestreet/agent_skills/blob/master/socratic-tutor/SKILL.md
456•tosh•2d ago•101 comments

A live tree of systemd jobs on the boot console

https://codeberg.org/wvhulle/bootvine
208•orhunp_•3d ago•79 comments

Researchers discover rare star system that emits radio signals every 8 minutes

https://www.curtin.edu.au/news/media-release/researchers-discover-rare-star-system-that-emits-rad...
47•giuliomagnifico•3h ago•17 comments

Nvidia CEO Jensen Huang resigns after reports of second affair deepened scandal

https://www.bbc.co.uk/news/live/c6zjry11v8w1t
65•cognoboffin•43m ago•31 comments

Talking Zen 6 with Mike Clark at AMD In-Depth

https://chipsandcheese.com/p/talking-zen-6-with-mike-clark-at
4•dverlaeckt80•27m ago•0 comments

Libreagi – Save OSS Models

https://libreagi.com/
4•satuke•27m ago•0 comments

Tim Peters has died

https://discuss.python.org/t/in-memoriam-tim-peters-1952-2026/110028
1313•ayhanfuat•1d ago•157 comments

93% of paint splatters are valid Perl programs (2019)

https://www.mcmillen.dev/sigbovik/
511•zenincognito•16h ago•64 comments

Critical RCE Vulnerability in Apache HTTP Server

https://www.wiz.io/blog/cve-2026-119618-rce-apache-http-server-vulnerability
295•soheilpro•12h ago•137 comments

Anthropic IPO

https://ipo.anthropic.com/us/
257•josephljohnston•2h ago•294 comments

AWS emulator

https://github.com/aws/aws-emulator
906•super_linear•20h ago•250 comments

Making a €40 USB-C hub work as a Nintendo Switch 2 dock

http://blog.nozomi.space/posts/sw2_dock/
81•mkopec•2d ago•25 comments

Research taste in history: the importance of learning Babylonian math

https://resobscura.substack.com/p/research-taste-in-history-the-importance
36•benbreen•1d ago•3 comments

Electric Ship Batteries Promise Compact, Cooler Power

https://spectrum.ieee.org/electric-ship-batteries
3•rbanffy•33m ago•0 comments

Jane Street – Our software engineering interviews are changing (a little)

https://blog.janestreet.com/software-engineering-interviews-are-changing-a-little/
4•maitland•34m ago•0 comments

A false smoke alarm almost drowned Jane Street's only NYC datacenter

https://michael.bacarella.com/2026/11/10/false-smoke-alarm-jane-street-datacenter/
533•mbac32768•22h ago•255 comments

Gemini Decisions API

https://blog.google/innovation-and-ai/technology/developers-tools/gemini-decisions-api/
500•iamdelirium•20h ago•148 comments

I'm Working on a FOSS Linux Pinbal Simulation Engine

https://www.getlazarus.org/forums/topic/17/
86•sysrpl•8h ago•30 comments

Nvidia is preparing to oust Jensen Huang

https://www.wsj.com/business/nvidia-is-preparing-to-oust-nvidia-ceo-jensen-huang-30f421ad
1172•jbredeche•16h ago•1563 comments

Nvidia CEO Jensen Huang resigns after reports of extramarital relationships

https://www.nbcnews.com/tech/tech-news/nvidia-ceo-jensen-huang-resigns-reports-extramarital-relat...
18•sonabinu•38m ago•9 comments

Show HN: Build a PC in 3D in the Browser

https://www.buildcores.com
14•ozaiworld•3d ago•3 comments

United Airlines bans AI agents from booking flights on behalf of travelers

https://www.cbsnews.com/news/united-airlines-bans-ai-agents-booking-flights/
609•herpderperator•17h ago•632 comments

Lock Your GitHub Actions

https://hugovk.dev/blog/2026/lock-github-actions/
302•gslin•16h ago•60 comments

Grote Reber and the 'Square Kilometre Array' Near Bothwell, Tasmania (2017)

https://www.researchgate.net/publication/319702287_THE_HISTORY_OF_EARLY_LOW_FREQUENCY_RADIO_ASTRO...
17•NaOH•3d ago•2 comments

Emacs in the Age of Magic

https://commandlinesystems.com/magic.txt
276•ggcr•18h ago•127 comments

Show HN: Aircad – Professional drafting and 3D modeling in the browser

https://aircad.com
66•peetle•1d ago•24 comments