lewissbaker / cppcoro

A library of C++ coroutine abstractions for the coroutines TS
MIT License
3.43k stars 472 forks source link

File I/O for Linux #160

Open GIGte opened 4 years ago

GIGte commented 4 years ago

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:

It does not include:

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