I/O event notification mechanism - select() or epoll() ?

Jonathan Neuschäfer j.neuschaefer at gmx.net
Fri Sep 28 13:05:55 EDT 2012


On Wed, Sep 26, 2012 at 05:19:50PM +0530, Rahul Bedarkar wrote:
> Hi,
> 
> I have to capture kernel udev events through libudev. One of API
> provides asynchronous events by reading on file descriptor. I found
> that there two ways to do that.
> 
> 1) select call
> 2) epoll
> 
> I also found that epoll is smarter and meant to replace old select call.
> 
> What are your thoughts on these ? Which one is better ?

I personally prefer event loop libraries such as libev[1]. They handle
all the interfacing with the event mechanism the OS provides, so you
only need to register a callback function.

HTH,
Jonathan Neuschäfer

[1] http://software.schmorp.de/pkg/libev.html



More information about the Kernelnewbies mailing list