From mboxrd@z Thu Jan 1 00:00:00 1970 From: j.neuschaefer@gmx.net (Jonathan =?utf-8?Q?Neusch=C3=A4fer?=) Date: Fri, 28 Sep 2012 19:05:55 +0200 Subject: I/O event notification mechanism - select() or epoll() ? In-Reply-To: References: Message-ID: <20120928170555.GA2820@debian.debian> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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