Event Notification Framework

This is OBSOLETE. Please use the IO API from libowfat

During the fnord development I decided to measure the relative performance of using poll(2) or platform specific performance hacks to write a web server. The problem with the platform specific hacks is that there are so many of them. So I decided to create a nice framework that would be relatively easy to use but still extensible to support new event notification APIs without having to rewrite the application.

The main difference between the APIs is that some are level triggered (if the API says "you can read now" and you don't read, the API will tell you again) and some are edge triggered. poll(2) is level triggered, the Linux 2.4 real-time signal based sigio is edge triggered, and the Linux 2.6 epoll API is edge triggered as well.

Fortunately, an application written for an edge triggered API also works with level triggered API. In fact, it is more efficient than normal code written for level triggered APIs.

There is no mailing list about enot yet. Please discuss it on the fnord mailing list. If there is enough interest, enot will get its own mailing list.

Please read the announcement I posted to the fnord mailing list about enot if you are looking for some timings.


You can get the sources per anonymous CVS:

  $ cvs -d :pserver:cvs@cvs.fefe.de:/cvs login
  (Logging in to cvs@cvs.fefe.de)
  CVS password: [just hit return]
  $ cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co enot


Basically, you define read, write and error callbacks. In the callback, you return either NOTHING (which means you handled the callback), IKNOW (which means you don't want to handle it now and you don't want to be notified again about this), OPPOSITE (in the read callback it means you now want to write, in the write callback it means you now want to read) or REMOVE (means you are done, please clean up and close the fd).

Please read artillery.c for usage info.

The header files define a bigger API than is actually there. I have not implemented the timeout stuff because I am not yet sure how to do it properly.

See Also