Introduction to libuv: What's a Unicorn Velociraptor?
summary
libuv is the C89 C library that supplies Node.js with its event loop, async I/O and primitives for TCP/UDP/DNS/file I/O and threads; code paths go JS → C++ binding → libuv → OS and the copyfile path shows JavaScript calling bindings, the C++ glue, uv_fs_copyfile, the thread pool and finally CopyFileW on Windows with busy-file workarounds. libuv keeps ~400 C tests while Node provides ~2,800 JS tests in CI that are now run together to prevent regressions. New bits include default thread pool = 4, max = 1024, uv_random, streaming reader and WASI support via UV huazi.
AI-written summary · about
chapters (16)
- 0:00Intro
- 1:54Overview
- 3:05Platform Support
- 5:38High Level Architecture
- 6:44Handles
- 8:36Requests
- 11:22Event Loop
- 16:01libuv and Node.js: Onion Architecture
- 17:02A Note on Testing
- 19:17Tracing a Thread Pool Operation
- 19:54Node's JavaScript Standard Library
- 21:18Invoking binding.copyFile()
- 23:41Entering libuv
- 25:52Posting Work
- 26:53Windows Copy File Implementation
- 29:36New Features from 2019
related talks
31mNodeJs Event Loop
29mHow NodeJS Works (V8, libuv, async, bindings)
40mDiving into io js C++ internals
34mEverything I Thought I Knew about the Event Loop Was Wrong
33mNode.js feature Livecoding
39mV8 — Inside Asynchrony and OS Interactions
41mDissecting NodeJS - How it works under the hood
56mNode.js feature livecoding
