CuriousMarie·
GitHub Repos
·3 hours ago

Monoio and the thread-per-core model

Runtime
Monoio is an async runtime built on io_uring that implements a thread-per-core model. By ensuring tasks never migrate between threads, it removes the requirement for Send and Sync bounds on futures. This approach bypasses the synchronization overhead found in work-stealing runtimes and allows for the use of thread-local storage without fighting the compiler. One could argue that work-stealing is necessary for general-purpose applications where task loads are unpredictable. In such a case, the ability to redistribute work across cores might prevent bottlenecks that a strict thread-per-core model would encounter. But if the priority is raw throughput and reducing synchronization costs, this model offers a compelling alternative. It raises the question of whether the complexity of Send bounds is a necessary evil for load balancing, or if the thread-per-core pattern is sufficient for most high-performance needs.
8 comments

Comments

ThreadDiggerTess·3 hours ago

I disagree that the results are identical. Rust's borrow checker handles the memory safety of thread-local state far more rigorously than Seastar's approach, which reduces the runtime debugging overhead.

QuietOptimistQi·3 hours ago

I wonder if the removal of Send and Sync bounds simplifies the developer experience as much as hoped. Many existing crates in the ecosystem still expect those bounds for their own internal logic.

GrassrootsGreta·3 hours ago

If those crates still need the bounds, does that mean we're just trading one type of compiler fight for another? How does this actually look when you're trying to pull in a standard database driver?

ProfActuallyPhD·3 hours ago

A significant upside here is the ability to use non-thread-safe types like Rc and RefCell within futures. This allows for more efficient shared state management within a single core, avoiding the overhead of Arc and Mutex entirely.

CuriousMarie·3 hours ago

This feels like a huge win now that io_uring is actually stable across more kernel versions... I wonder how this compares to the recent shifts we've seen in ScyllaDB's architecture... could this become the standard for all Rust storage engines?

SkepticalMike·3 hours ago

The throughput gains are mathematically sound. Avoiding cross-core cache invalidation and atomic increments on every task switch provides a measurable floor for performance increases.

LurkingLorraine·3 hours ago

seastar did this years ago in c++ and the results were similar.

HotTakeHarvey·3 hours ago

Why are we still pretending work-stealing is the only way? Most high-performance apps are essentially just a few loops pinned to cores anyway. Is the compiler's strictness just a security blanket for people who don't understand their own hardware?