In response to issues brought up by the OP of the following thread, Rust beginner notes & questions, regarding the efficiency & long-term viability of Rust IO API's in the stdlib (and elsewhere), I have created this thread as a discussion place to work through some of these concerns and flesh out the requirements and whether those requirements are currently being met by libraries on crates.io already under development, or, whether a new project needs to begin to address the concerns.
In particular, the following comments on the above referenced thread are what this discussion thread should center upon:
- Rust beginner notes & questions - #70 by peter_bertok
- Rust beginner notes & questions - #78 by peter_bertok
- Rust beginner notes & questions - #97 by peter_bertok
- Rust beginner notes & questions - #100 by peter_bertok
And here are some comments (by myself) from the other thread regarding possible ways forward to explore this topic more deeply:
- Rust beginner notes & questions - #101 by gbutler69
- Rust beginner notes & questions - #105 by gbutler69
In particular, the last comment I made on the previous thread, which I'll repeat here as the jumping off point for this thread:
- It would be good to consider how this API could fit comfortably into the Redox (and perhaps TockOS) world
- Linux/Unix/Windows/Redox (all similar performance with a user-level API that abstracts away any and all OS-specific issues [to the degree possible])
- Use Cases:
- Network IO
- Database IO
- File IO
- Modern Memory/Storage Architectures
- Cache friendliness at all levels
- Ergonomic
- Opinionated (make the "right" thing easy and the wrong thing impossible or difficult)
- Async/Future friendly
- Generator friendly
- Reactive (pull vs push) / Back-Pressure friendly
- EDIT: Expose a "Safe" C-API (interop)
Things to accomplish on this thread:
- solidify the requirements
- survey the existing crates.io efforts and how they do/do not meet the requirements
- analyze C# PIpes API and Java NIO and perhaps others for ideas/inspiration and/or problems to avoid
- spin up a repo to begin the Trait/Interface designs and make decisions about how this should all interoperate etc. (as I mentioned above).
QUESTION: To what degree is tokio already addressing the concerns raised? Can tokio be enhanced with the necessary functionality? Can a higher-level library be created over tokio/mio to address the issues? Can should a lower-level library be created that tokio and other higher-level libs could leverage and that would work in conjunction with mio be the way forward?
Thoughts?
API's for inspiration:
- Java NIO
- C#/.Net-Core Pipelines
- seastar and spdk (thanks @vitalyd)
Existing relevant Crates on crates.io:
EDIT 2: Here is a Reddit discussion regarding some new developments on the Tokio front relevant to this topic: https://www.reddit.com/r/rust/comments/8yuo07/tokio_io_pool_a_runtime_for_io_heavy_applications/