cratetorrent icon indicating copy to clipboard operation
cratetorrent copied to clipboard

Use io_uring?

Open ArniDagur opened this issue 4 years ago • 4 comments
trafficstars

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

ArniDagur avatar Jan 20 '21 21:01 ArniDagur

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

vimpunk avatar Apr 13 '21 16:04 vimpunk

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.

vimpunk avatar Apr 13 '21 17:04 vimpunk

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.

ArniDagur avatar Apr 13 '21 18:04 ArniDagur

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

vimpunk avatar Aug 14 '21 08:08 vimpunk