cppcoro icon indicating copy to clipboard operation
cppcoro copied to clipboard

File I/O for Linux

Open GIGte opened this issue 3 years ago • 0 comments

This uses io_uring API. To get things working you need a fairly recent kernel (at least version 5.6).

Why io_uring: Making a comparable implementation for older versions of Linux kernel using a different API seems troublesome. For example, epoll only works well with sockets, and Linux AIO requires O_DIRECT flag (no caching and needs buffer alignment) when opening files. Also Linux AIO has no real support for anything socket-specific.

This pull request includes:

  • Scheduling operations with io_service.
  • File read, write & cancel.

It does not include:

  • Scheduling with timer.
  • Sockets.

I also updated CMake files from #158 inside a separate branch in my repository to reflect the additions. This might be useful for someone.

GIGte avatar Aug 27 '20 19:08 GIGte