libcoro icon indicating copy to clipboard operation
libcoro copied to clipboard

Support for file IO?

Open yuzhichang opened this issue 1 year ago • 2 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.

yuzhichang avatar Sep 27 '23 14:09 yuzhichang

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

jbaldwin avatar Sep 28 '23 18:09 jbaldwin

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

jbaldwin avatar Dec 20 '23 18:12 jbaldwin