jbaldwin / libcoro

C++20 coroutine library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for file IO?

yuzhichang opened this issue · comments

asio supports io_uring.
It's great if libcoro support async file IO (io_uring on Linux, IOCP on Windows etc.), so that read/write yield thread to another coroutine.

I'm not that familiar with io_uring yet, it seems quite promising but this is definitely a larger task to either:
(a) replace epoll with io_uring -- this solution would mandate a minimum kernel version probably
(b) support both epoll and io_uring - I'm not particularly interested in this approach, I'd rather keep the code simple, I imagine there would be subtle bugs between the two kernel apis and would require a lot of testing and effort to maintain both

Another option might be to have a background thread pool which blocks on the file io requests while maintaining epoll.