#thread-per-core #io-uring #async #async-await #linux-kernel #rust

glommio

Glommio is a thread-per-core crate that makes writing highly parallel asynchronous applications in a thread-per-core architecture easier for rustaceans

8 releases (breaking)

0.9.0 Mar 25, 2024
0.8.0 Jan 26, 2023
0.7.0 Feb 10, 2022
0.6.0 Sep 14, 2021
0.2.0-alpha Nov 6, 2020

#169 in Asynchronous

Download history 277/week @ 2024-08-18 722/week @ 2024-08-25 1035/week @ 2024-09-01 719/week @ 2024-09-08 243/week @ 2024-09-15 729/week @ 2024-09-22 914/week @ 2024-09-29 1049/week @ 2024-10-06 887/week @ 2024-10-13 689/week @ 2024-10-20 361/week @ 2024-10-27 315/week @ 2024-11-03 143/week @ 2024-11-10 254/week @ 2024-11-17 397/week @ 2024-11-24 385/week @ 2024-12-01

1,196 downloads per month
Used in 23 crates (16 directly)

Apache-2.0 OR MIT

2MB
49K SLoC

Rust 27K SLoC // 0.0% comments C 21K SLoC // 0.1% comments Shell 178 SLoC // 0.2% comments RPM Specfile 55 SLoC C++ 32 SLoC // 0.1% comments

glommio

crates.io docs.rs license project chat CI

Join our Zulip community!

If you are interested in Glommio, consider joining our Zulip community. Tell us about exciting applications you are building, ask for help, or just chat with friends 😃

What is 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 one to write asynchronous code that takes advantage of rust async/await, but unlike its counterparts, it doesn't use helper threads anywhere.

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 {
    /// your async code here
})
.expect("failed to spawn local executor")
.join();

For more details check out our docs page and an introductory article.

Supported Rust Versions

Glommio is built against the latest stable release. The minimum supported version is 1.65. The current Glommio version is not guaranteed to build on Rust versions earlier than the minimum supported version.

Supported Linux kernels

Glommio requires a kernel with a recent enough io_uring support, at least current enough to run discovery probes. The minimum version at this time is 5.8.

Please also note Glommio requires at least 512 KiB of locked memory for io_uring to work. You can increase the memlock resource limit (rlimit) as follows:

$ vi /etc/security/limits.conf
*    hard    memlock        512
*    soft    memlock        512

Please note that 512 KiB is the minimum needed to spawn a single executor. Spawning multiple executors may require you to raise the limit accordingly.

To make the new limits effective, you need to log in to the machine again. You can verify that the limits are updated by running the following:

$ ulimit -l
512

Contributing

See Contributing.

License

Licensed under either of

at your option.

Dependencies

~7–13MB
~169K SLoC