Preferred library ? ------------------------------- Message Body ----------------------

Hi,Wouter!

   Thank you for answer!

[..]

builtin is the default, and is extremely portable. Also optimized. The
builtin is based on select(2) and limited to 1024 file descriptors. This
is fine if you use default config.

   But how about kqueue(2) on FreeBSD ?

  Alexander

Alexander Kolesnikoff wrote:

   Thank you for answer!
   But how about kqueue(2) on FreeBSD ?

libevent and libev support it. (and its quirks on MacOS/X).

Best regards,
~ Wouter

Excellent! I'm just curious, how unbound use kqueue(2) ? On my FreeBSD box
top(1) said:

  PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND
6158 bind 1 96 0 7852K 3744K select 0:00 0.00% unbound

Why STATE is "select" but not "kqueue" ? unbound was compiled with libev-3.2.

  Alexander

Alexander Kolesnikoff wrote:

  Excellent! I'm just curious, how unbound use kqueue(2) ? On my

FreeBSD box

top(1) said:

  PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND
6158 bind 1 96 0 7852K 3744K select 0:00 0.00% unbound

Why STATE is "select" but not "kqueue" ? unbound was compiled with

libev-3.2.

Hi Alexander,

Scan through libev-3.2 shows this:
#ifndef __NetBSD__
~ /* kqueue is borked on everything but netbsd apparently */
~ /* it usually doesn't work correctly on anything but sockets and pipes */
~ flags &= ~EVBACKEND_KQUEUE;
#endif

So that is why it is not using kqueue on FreeBSD. Seems like
libevent-1.4.3-stable does do kqueue on FreeBSD (from a cursory source
look).

Now, unbound only uses sockets and pipes, so you could edit out this bit
in your source (for unbound only) if you really want kqueue and libev.

If you find bugs or fixes for FreeBSD, let those two projects know.
(This is a nice of saying, that unbound uses libev, libevent precisely
to avoid this kind of portability trouble).

Best regards,
~ Wouter