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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Sep 26, 2012 at 7:49 PM, Rahul Bedarkar <rpal143@xxxxxxxxx> 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

I guessed when u called select() it will block, and so u can be very efficient - doing nothing until necessary, but also resource being used up - as the process is solely dedicated to listenting for event only.
 
2) epoll

good thing is u can parallel process other stuff at the same time, if after polling the replies from udev is not back yet.   but the bad thing is response may not be so immediate, as u may be doing something else when the udev event comes in.
 
I also found that epoll is smarter and meant to replace old select call.

What are your thoughts on these ? Which one is better ?

Thanks
Rahul B.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



--
Regards,
Peter Teoh
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux