Change select(2) to kevent(2) on script(1)...

Maxim Sobolev sobomax at FreeBSD.org
Mon Dec 22 10:57:04 UTC 2008


Norikatsu Shigemura wrote:
> Hi Ed!
> 
> 	I inspired by your 'kqueue()-support to pseudo-terminal master
> 	devices' (svn commit: r185942).  So I'm trying to use kevent(2)
> 	on script(1). (SEE ALSO following patch)

It's unrelated question, but I wonder what the reason to do this might 
be? AFAIK kqueue(2) provides performance benefit only for the cases when 
one needs to monitor large number of file descriptors. In this case 
there are just 2 descriptors. The kqueue(2) has big disadvantage of 
being non-POSIX, FreeBSD-specific interface, making it harder for 
somebody to adapt the code in non-FreeBSD environment. For this reason 
IMHO it should only be used for really performance critical code. For 
other cases select(2)/poll(2) should be the interface of choice.

-Maxim


More information about the freebsd-current mailing list