vimpunk / cratetorrent

A BitTorrent V1 engine library for Rust (and currently Linux)
468 stars 35 forks source link

Use io_uring? #100

Open ArniDagur opened 3 years ago

ArniDagur commented 3 years ago

It might be interesting to use io_uring for asynchronous IO. It is Linux specific, but so is pwritev and preadv.

vimpunk commented 3 years ago

I've been thinking about this as well, io_uring seems well suited for the torrenting use case. Thanks for the suggestion.

vimpunk commented 3 years ago

The decision here is going to be effected by whether we want to support windows or not. I'd be fine with linux only but there has been some interest in bringing cratetorrent to windows, so it's unclear whether this makes sense going forward. I would very much like to have cratetorrent as a base to experiment with io_uring, though, maybe with the new tokio-uring experimental crate.

Maybe there could be support for both windows and io_uring via compilation switches, since the proposed API of tokio-uring should be fairly similar to that of tokio.

ArniDagur commented 3 years ago

I'm currently writing a torrent client in C++ which uses io_uring (school coursework). I use it for both networking and file system operations. I must say that the experience has been great so far.

vimpunk commented 3 years ago

@ArniDagur sounds interesting. Would you mind digging into the architecture of your torrent client with regard to how it uses io_uring?