Re: to select() or poll() ??



On Mon, 13 Nov 2006 19:12:38 +0000, Casper H. S. Dik wrote:

spambox1@xxxxxxxxxxxxxx writes:

Which asynchronous multiplexer is "recommended" to use, select() or
poll(). From the Solaris man pages, I read the following;

"The poll(2) function is preferred over this function. It must be
used when the number of file descriptors wxceeds FD_SETSIZE"

Linux offers in libevent a "call back" functionality for multiplexing I/O
desccriptors. Are these functions accepted as portable standard c
libraries?

poll(2) is a standard "POSIX" function. Solaris also has "/dev/poll"
(from S2.6 or 7) and event ports (starting in Solaris 10).

Noen of libevent, /dev/poll or event ports are standard.


libevent is a userland library. It's not even native to Linux, but rather
can be found in a base install of OpenBSD and NetBSD (where the author
was/is a contributor). libevent is meant as an abstraction over /dev/poll,
select, poll, epoll, kqueue, etc.

To the OP: if you're concerned about which polling interface to use, and
you've already used libevent, I'd say stick to libevent and let _it_ make
the decision for you. On Linux libevent will likely chose epoll, and on
Solaris, /dev/poll (and possible event ports in a future version).


.



Relevant Pages

  • Re: to select() or poll()
    ... poll(). ... From the Solaris man pages, ... Are these functions accepted as portable standard c ... In short, no. They're fairly portable, but not standard C (they are part of POSIX). ...
    (comp.std.c)
  • Re: to select() or poll() ??
    ... of select, poll, and libevent seem to indicate that select/poll out ... If two pieces of software used poll(); one in its own event loop and the ...
    (comp.unix.programmer)
  • to select() or poll() ??
    ... performance at _least_ as well as a straight poll/select loop, ... If two pieces of software used poll(); one in its own event loop and the ... other using libevent, barring any extraordinary circumstances they both ... I have never used epoll, ...
    (comp.unix.programmer)
  • Re: to select() or poll() ??
    ... of select, poll, and libevent seem to indicate that select/poll out ... preform libevent, while the libevent api makes development and long term ... scalable polling interfaces. ... I have found "issues" using poll ...
    (comp.unix.programmer)
  • Re: to select() or poll() ??
    ... preform libevent, while the libevent api makes development and long term ... performance at _least_ as well as a straight poll/select loop, ... interfaces. ... select or poll may perform better and likely will. ...
    (comp.unix.programmer)