glommio icon indicating copy to clipboard operation
glommio copied to clipboard

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

Open hoijui opened this issue 2 years ago • 4 comments

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? ...

hoijui avatar Jan 04 '24 09:01 hoijui

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.

benauthor avatar Feb 02 '24 03:02 benauthor

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 avatar Feb 02 '24 08:02 hoijui

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?

hoijui avatar Feb 02 '24 08:02 hoijui