9

How can you combine AIO and epoll together in a single event loop?

Google finds lots of talk from 2002 and 2003 about unifying them, but its unclear if anything happened, or if it's possible.

Has anyone rolled-their-own with an epoll loop using eventfd for the aio signal?

Will
  • 73,905
  • 40
  • 169
  • 246
  • Realise this is very old question, but you could use 'signalfd' for the signal from aio – Steve Lorimer May 25 '13 at 00:33
  • Are you referring to POSIX AIO or Linux AIO? The latter allows to register an eventfd for completion notifications. And that eventfd you could add to your epoll fd set. – maxschlepzig May 15 '21 at 09:47

4 Answers4

5

try libevent:

http://www.monkey.org/~provos/libevent/

there are patches to support both.

Ass3mbler
  • 3,855
  • 2
  • 20
  • 18
  • The new libeevent 2.0 is going completion-based: http://google-opensource.blogspot.com/2010/01/libevent-20x-like-libevent-14x-only.html - hopefully AIO will turn up as a backend so you can mix file and network descriptórs – Will Mar 25 '10 at 19:04
3

you can see http://www.xmailserver.org/eventfd-aio-test.c for a sample of aio and eventfd

ury
  • 83
  • 1
  • 5
  • Interestingly, according to https://oxnz.github.io/2016/10/13/linux-aio/ now there is `#include ` so there's no need to resort to `__NR_io_setup` – nponeccop Sep 02 '18 at 22:32
1

Tried eventfd with epoll?

"A key point about an eventfd file descriptor is that it can be monitored just like any other file descriptor using select(2), poll(2), or epoll(7)."

jcaose
  • 23
  • 5
0

FreeBSD supports AIO together with Kqueue, the AIO completion can be monitored by the Kqueue interface.

Johan B
  • 890
  • 3
  • 23
  • 39
angel
  • 9
  • 1