DataDog / glommio

Glommio is a thread-per-core crate that makes writing highly parallel asynchronous applications in a thread-per-core architecture easier for rustaceans.
Other
3.12k stars 164 forks source link

Document what happens on non-Linux+io-uring-support #634

Open hoijui opened 10 months ago

hoijui commented 10 months ago

The README states the requirements for a Linux kernel to support io_uring. It does not state what happens, if this library is used on a non-Linux system, or on a Linux system that does not support io_uring. Are there compilation failures? runtime-failures? fallbacks? Is there work being done on supporting anything else, or does it not make sense to support anything else? what fallbacks are suggested for other systems? ...

benauthor commented 9 months ago

You'll see compilation errors. io_uring is a linux API. The story for cross-platform network I/O in async rust does look fairly promising, for example see https://github.com/tokio-rs/mio. But for file I/O, all the cross-platform rust async runtimes I've looked at just throw blocking operations into a threadpool. This was a motivator for Glommio.

hoijui commented 9 months ago

ahhh... thank you! :-) so ... how do you envision clients (users of this library) to use it? After this explanation, I imagine they would want to use config flags to use this library on linux, if a runtime check confirms io-uring support, and in all other cases fall back to e.g. tokios async file-system impl? (except they only want to support io0uring linux systems)

Is it maybe already used like this somewhere, and the README could link to that?

hoijui commented 9 months ago

And .. as I have no idea... how many, or which kinds/classes of linux systems do generally support io-uring? does it only depend on the kernel as explained in your README, or also the hardware? (e.g. embedded systems?)

... or is your library anyway only meant to be used by libraries like tokio internally (and which probably would already know all this), and not by people writing applications directly?