A Programmer-Friendly I/O Abstraction Over io_uring and kqueue
TigerBeetle's I/O layer wraps io_uring on Linux and kqueue on macOS behind a single callback-based, completion-oriented API, so business logic can schedule reads and writes anywhere instead of in one giant switch loop. Callbacks travel through the kernel's opaque user_data field. A flush/run_for_ns pair submits batches and polls completions. An intrusive-linked-list overflow queue holds requests when the fixed-size ring is full. On io_uring the kernel performs the actual send/recv, while the kqueue backend waits for readiness and then makes the syscall in userland. The design is a single-threaded event loop similar to libuv, chosen for simplicity and for the determinism needed by Deterministic Simulation Testing; per-thread queues and shared-queue worker pools are discussed as alternatives for parallel workloads.
Related posts
- Async Rust
Zed mediumAdeptZed's GPUI framework runs async Rust without tokio or smol: it uses async_task for tasks and thin wrappers around macOS Grand Central Dispatch as the executor, dispatching Runnables via dispatch_async_f onto the main queue or a high-priority global queue through a trampoline function. GPUI separates a ForegroundExecutor (main thread, which handles rendering and input and must never block) from a BackgroundExecutor (GCD global queue). Code walkthroughs from the editor, terminal search and project-wide search show the pattern of keeping quick work on the main thread and pushing lock acquisition, file scanning and searching to background tasks so frames hit the 8ms budget at 120 FPS.
- Writing High-Performance Clients for Tigerbeetle
TigerBeetle mediumAdeptTigerBeetle builds every language client as a thin wrapper over a single Zig client library, tb_client, exposed through FFI. This avoids reimplementing the VSR protocol, io_uring and static allocation in each language. Zero-deserialization works directly with Go and C# structs. Java instead uses a ByteBuffer-backed Batch object so JNI can read contiguous memory without per-object copying or GC pressure. tb_client runs a dedicated thread with completion callbacks, which each binding wraps in its own concurrency idiom: goroutines, async/await and CompletableFuture. A client-side benchmark of 1M rejected transfers shows near-native throughput (Zig 1.56M/s, C# 1.52M/s, Go 1.47M/s, Java 1.27M/s). Zig's cross-compilation offsets the cost of per-platform builds.
- Announcing Silk: a silky smooth fiber runtime for ClickHouse
ClickHouse hardMaster
Silk is a C++ stackful-fiber runtime for ClickHouse. It pins one scheduler thread per CPU, uses io_uring as its I/O foundation, steals work in order of CPU topology cost (hyperthread sibling, then same socket, then cross-socket), and does zero heap allocation in the steady-state hot path through mmap'd stack pools, stack-resident futures and intrusive containers. Its benchmarks report about 3.6 ns per yield, 5.9M file IOPS and roughly 4-15x boost::asio throughput, and it argues that Photon's cache-aliasing penalty comes from slab-allocated stacks rather than from stackful fibers. The tradeoffs are that it runs only on Linux, uses a process-wide singleton scheduler and caps fiber parameters at 64 bytes. Its first target is ClickHouse's distributed cache, where internal tests showed about 65% better p99.9 latency than a thread pool.
- Hardening eBPF for runtime security: Lessons from Datadog Workload Protection
Datadog Engineering hardMasterFive years of running Datadog Workload Protection, an eBPF-based runtime security agent supporting kernels from 4.15 to 6.18, distilled into six production lessons. They cover getting programs to load, attach and keep firing across kernels and distributions; capturing and enriching data correctly; auditing eBPF use to reduce attack surface; coexisting with other eBPF users on a host; controlling performance cost; and shipping changes safely. Concrete pitfalls include verifier differences between kernels, inlined or renamed hook points, missed 32-bit compat syscalls and per-syscall tracepoints, and gaps from io_uring, openat2 and unusual exec paths like binfmt_misc. Mitigations include a CI matrix of tested kernels, the shared open source ebpf-manager Go library that refuses to start without a minimal set of loaded programs, and wrappers that hide verifier quirks.
- The Adventures of Rendezvous in Heroku’s New Architecture
Heroku Engineering mediumAdeptMoving Heroku's Rendezvous proxy, which splices CLI and one-off dyno connections across NATs, from EC2 Classic to VPC behind AWS Network Load Balancers with TLS termination broke one customer's request-scoped one-off dyno workflow with H12 router timeouts. The root cause was a single-threaded agent loop using IO.select on the raw TCP socket. The NLB's larger TLS frames left decrypted bytes buffered inside OpenSSL's SSLSocket where IO.select couldn't see them, so the loop blocked until an idle timeout longer than the router's 30s limit. The fix split the agent into one thread per direction and changed the read logic so buffered SSL data is drained before selecting again.