From mboxrd@z Thu Jan 1 00:00:00 1970 From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com) Date: Fri, 28 Sep 2012 07:23:47 +0200 Subject: I/O event notification mechanism - select() or epoll() ? In-Reply-To: References: Message-ID: <20120928052346.GA2274@grml> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi! On 17:19 Wed 26 Sep , 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 ? If you are ok to be limited to linux, I would highly recommend using epoll because of scaleability. Using select is almost like creating a new epoll descriptor for every call instead of reusing it. -Michi -- programing a layer 3+4 network protocol for mesh networks see http://michaelblizek.twilightparadox.com