Overview
Glommio
Glommio (pronounced glo-mee-jow or |glomjəʊ|) is a Cooperative Thread-per-Core crate for Rust & Linux based on io_uring. Like other rust asynchronous crates, it allows you to write asynchronous code that takes advantage of rust async/await, but unlike its counterparts, it doesn't use helper threads anywhere.
Key Features
- Thread-per-Core Architecture: Each CPU core runs a single thread, eliminating context switches and lock contention
- io_uring Based: Leverages Linux's modern asynchronous I/O interface for maximum performance
- Cooperative Scheduling: Tasks yield explicitly, allowing for predictable latency and efficient resource usage
- Zero Helper Threads: No background threads, no work-stealing, no surprises
- CPU Pinning: Pin executors to specific CPUs for cache locality and predictable performance
Getting Started
Using Glommio is not hard if you are familiar with rust async. All you have to do is:
use glommio::prelude::*;
LocalExecutorBuilder::default()
.spawn(|| async move {
// Create a file
let file = OpenOptions::new()
.write(true)
.create(true)
.open("example.txt")
.await?;
// Write data asynchronously
file.write_at(b"Hello, Glommio!", 0).await?;
Ok(())
})
.expect("failed to spawn executor")
.join();Requirements
- Linux kernel 5.8+ with io_uring support
- Rust 1.65+ (MSRV)
- 512 KiB locked memory for io_uring (adjust
memlockrlimit)
Resources
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.