Re: to select() or poll() ??
- From: William Ahern <william@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Nov 2006 14:08:19 -0800
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).
.
- Follow-Ups:
- Re: to select() or poll() ??
- From: Rainer Weikusat
- Re: to select() or poll() ??
- References:
- to select() or poll() ??
- From: spambox1
- Re: to select() or poll() ??
- From: Casper H . S . Dik
- to select() or poll() ??
- Prev by Date: Re: I need to find a file in Unix using C
- Next by Date: Re: Shell
- Previous by thread: Re: to select() or poll() ??
- Next by thread: Re: to select() or poll() ??
- Index(es):
Relevant Pages
|