vibe-d / eventcore

High performance proactor event loop abstraction library
MIT License
60 stars 42 forks source link

Use io_uring where sensible #176

Open Panke opened 3 years ago

Panke commented 3 years ago

I am investigating the usage of io_uring as a backend for eventcore. Let's gather all discussion surrounding it in this issue.

To the best of my understanding there are two approaches to do this.

  1. Integrate it into the posix event loop as an additional event source similar to timers. Wake up the posix event loop by registering an eventfd that fires, when io_uring completions are available. This is done in the outstanding PR.
  2. Replace the posix event loop with an io_uring based event loop completely. Since io_uring does not support everything at the moment (notably signalfd does not work), we have to support epoll as well via IO_URING_OP_POLL_ADD.
s-ludwig commented 3 years ago

This seems to lend itself nicely for starting with 1, switching to 2 once a certain level of completeness is reached (IMO, at least sockets + files + events + pipes). Timers would probably go together with the switch, but could also stay implemented with the current approach of limiting the wait operation according to the earliest timer.