diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-05-14 20:17:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-14 20:17:18 +0000 |
commit | 69738c0fd03af19053c5701a984f923ecbbfada6 (patch) | |
tree | 9a5f4ea493dffbeaffa362bb516732bdde2cb27c /src/sys/mod.rs | |
parent | 1c36d49c0b7ef41ab3539b22dbe86cf3863fc219 (diff) | |
parent | 0c07a9e4690fc4b2d8ceb90ac463c79e50d70947 (diff) | |
download | nix-69738c0fd03af19053c5701a984f923ecbbfada6.zip |
Merge #1713
1713: Rewrite the aio module r=rtzoeller a=asomers
The existing AIO implementation has some problems:
1) The in_progress field is checked at runtime, not compile time.
2) The mutable field is checked at runtime, not compile time.
4) A downstream lio_listio user must store extra state to track whether
the whole operation is partially, completely, or not at all
submitted.
4) Nix does heap allocation itself, rather than allowing the caller to
choose it. This can result in double (or triple, or quadruple)
boxing.
5) There's no easy way to use lio_listio to submit multiple operations with
a single syscall, but poll each individually.
6) The lio_listio usage is far from transparent and zero-cost.
7) No aio_readv or aio_writev support.
8) priority has type c_int; should be i32
9) aio_return should return a usize instead of an isize, since it only
uses negative values to indicate errors, which Rust represents via
the Result type.
This rewrite solves several problems:
1) Unsolved. I don't think it can be solved without something like
C++'s guaranteed type elision. It might require changing the
signature of Future::poll too.
2) Solved.
3) Solved, by the new in_progress method and by removing the complicated
lio_listio resubmit code.
4) Solved.
5) Solved.
6) Solved, by removing the lio_listo resubmit code. It can be
reimplemented downstream if necessary. Or even in Nix, but it
doesn't fit Nix's theme of zero-cost abstractions.
7) Solved.
8) Solved.
9) Solved.
Co-authored-by: Alan Somers <asomers@gmail.com>
Diffstat (limited to 'src/sys/mod.rs')
0 files changed, 0 insertions, 0 deletions