cvs commit: src/lib/libnetgraph internal.h msg.c

Poul-Henning Kamp phk at phk.freebsd.dk
Mon May 14 21:11:31 UTC 2007


In message <200705141645.55584.jhb at freebsd.org>, John Baldwin writes:
>On Monday 14 May 2007 10:18:41 am Alexander Motin wrote:

>>   Log:
>>   Replace select() by poll() to avoid problems with big
>>   descriptor number.
>
>Why not kevent(2)?

kevent(2) is most useful if you have many descriptors open
(ie: apache).

poll(2) works quite well for a low number of descriptors,
and doesn't care what their numeric numbers are.

select(2) is terrible unless you have a limited number of descriptors
and they are all low numbered.  This is because of the array
representation.


Given that poll(2) is a much simpler API than kqueue(2), I'd
say it was the right choice here.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the cvs-src mailing list