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

Comments

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

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

Multiprocessing all the way!

emmelaich•7mo ago
(2021)

Good article!

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

Snitch – A friendlier ss/netstat

https://github.com/karol-broda/snitch
72•karol-broda•4h ago•10 comments

FCC Updates Covered List to Include Foreign UAS and UAS Critical Components [pdf]

https://docs.fcc.gov/public/attachments/DOC-416839A1.pdf
23•Espressosaurus•1h ago•4 comments

The Illustrated Transformer

https://jalammar.github.io/illustrated-transformer/
310•auraham•9h ago•64 comments

It's Always TCP_NODELAY

https://brooker.co.za/blog/2024/05/09/nagle.html
208•eieio•7h ago•58 comments

Ultrasound Cancer Treatment: Sound Waves Fight Tumors

https://spectrum.ieee.org/ultrasound-cancer-treatment
214•rbanffy•9h ago•60 comments

GLM-4.7: Advancing the Coding Capability

https://z.ai/blog/glm-4.7
279•pretext•10h ago•127 comments

Claude Code gets native LSP support

https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md
354•JamesSwift•13h ago•185 comments

Our New Sam Audio Model Transforms Audio Editing

https://about.fb.com/news/2025/12/our-new-sam-audio-model-transforms-audio-editing/
48•ushakov•6d ago•14 comments

NIST was 5 μs off UTC after last week's power cut

https://www.jeffgeerling.com/blog/2025/nist-was-5-μs-utc-after-last-weeks-power-cut
224•jtokoph•12h ago•99 comments

The Garbage Collection Handbook

https://gchandbook.org/index.html
168•andsoitis•9h ago•12 comments

Archivists Posted the 60 Minutes Cecot Segment Bari Weiss Killed

https://www.404media.co/archivists-posted-the-60-minutes-cecot-segment-bari-weiss-killed/
52•m-hodges•1h ago•1 comments

FPGAs Need a New Future

https://www.allaboutcircuits.com/industry-articles/fpgas-need-a-new-future/
122•thawawaycold•3d ago•76 comments

Scaling LLMs to Larger Codebases

https://blog.kierangill.xyz/oversight-and-guidance
229•kierangill•13h ago•89 comments

Flock Exposed Its AI-Powered Cameras to the Internet. We Tracked Ourselves

https://www.404media.co/flock-exposed-its-ai-powered-cameras-to-the-internet-we-tracked-ourselves/
489•chaps•12h ago•381 comments

Show HN: C-compiler to compile TCC for live-bootstrap

https://github.com/FransFaase/MES-replacement
36•fjfaase•5d ago•6 comments

The Duodecimal Bulletin, Vol. 55, No. 1, Year 1209 [pdf]

https://dozenal.org/drupal/sites_bck/default/files/DuodecimalBulletinIssue551.pdf
3•susam•3h ago•0 comments

Universal Reasoning Model (53.8% pass 1 ARC1 and 16.0% ARC 2)

https://arxiv.org/abs/2512.14693
81•marojejian•10h ago•10 comments

Plugins case study: mdBook preprocessors

https://eli.thegreenplace.net/2025/plugins-case-study-mdbook-preprocessors/
7•chmaynard•4d ago•0 comments

Remove Black Color with Shaders

https://yuanchuan.dev/remove-black-color-with-shaders
4•surprisetalk•4d ago•0 comments

Lotusbail npm package found to be harvesting WhatsApp messages and contacts

https://www.koi.ai/blog/npm-package-with-56k-downloads-malware-stealing-whatsapp-messages
239•sohkamyung•6h ago•143 comments

How the RESISTORS put computing into 1960s counter-culture

https://spectrum.ieee.org/teenage-hackers
50•rbanffy•5d ago•7 comments

Satellites reveal heat leaking from largest US cryptocurrency mining center

https://www.space.com/space-exploration/satellites/satellites-reveal-heat-leaking-from-largest-us...
92•troglo-byte•5h ago•70 comments

The biggest CRT ever made: Sony's PVM-4300

https://dfarq.homeip.net/the-biggest-crt-ever-made-sonys-pvm-4300/
236•giuliomagnifico•16h ago•148 comments

Things I learnt about passkeys when building passkeybot

https://enzom.dev/b/passkeys/
115•emadda•10h ago•66 comments

In Pursuit of Clancy Sigal (2021)

https://yalereview.org/article/in-pursuit-of-clancy-sigal
13•dang•8h ago•5 comments

Tc – Theodore Calvin's language-agnostic testing framework

https://github.com/ahoward/tc
21•mooreds•7h ago•4 comments

Debian's Git Transition

https://diziet.dreamwidth.org/20436.html
207•all-along•20h ago•73 comments

Show HN: Python SDK – forecasting with foundation time-series and tabular models

https://github.com/S-FM/faim-python-client
5•ChernovAndrei•4d ago•1 comments

Diesel pollution particles impair lysosomal functions of iPSC-derived microglia

https://www.sciencedirect.com/science/article/pii/S0160412025002181
17•PaulHoule•2h ago•3 comments

Uplane (YC F25) Is Hiring Founding Engineers (Full-Stack and AI)

https://www.useparallel.com/uplane1/careers
1•MarvinStarter•12h ago