Tweet by KentonVarda
April 11, 2026
Note that coalescing of writes is a separate thing from output gates. Writes that occur during a single visit to the isolate are automatically coalesced into a single atomic transaction. I just made up this term "visit" since we don't actually have a good term for this, but what it means is: we deliver some I/O event to the isolate, then we run the microtask loop until it is empty. This is all one "visit". Since we have our own runtime, yes, we are able to instrument the event loop to work how we want. We actually have two event loops: the microtask loop (which is specific to an isolate), and the outer KJ event loop (C++ code, using epoll, one per thread). Output gates, meanwhile, are implemented by instrumenting each type of I/O, such as fetch().
- Author
- KentonVarda
- Date
- April 11, 2026
- Canonical URL
- /tweets/kentonvarda-2043064767624155635-5a60a7