Has anyone ever thought about adding kqueue (for *BSD) support to Postgres,
instead of using select?
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
int
kqueue(void);
int
kevent(int kq, const struct kevent *changelist, int nchanges,
struct kevent *eventlist, int nevents,
const struct timespec *timeout);
EV_SET(&kev, ident, filter, flags, fflags, data, udata);
DESCRIPTION
kqueue() provides a generic method of notifying the user when an event
happens or a condition holds, based on the results of small pieces of
kernel code termed filters. A kevent is identified by the (ident, fil-
ter) pair; there may only be one unique kevent per kqueue.
The filter is executed upon the initial registration of a kevent in
order
to detect whether a preexisting condition is present, and is also exe-
cuted whenever an event is passed to the filter for evaluation. If the
filter determines that the condition should be reported, then the
kevent
is placed on the kqueue for the user to retrieve.
The filter is also run when the user attempts to retrieve the kevent
from
the kqueue. If the filter indicates that the condition that triggered
the event no longer holds, the kevent is removed from the kqueue and is
not returned.
Chris
> CVSROOT: /cvsroot
> Module name: pgsql-server
> Changes by: tgl@postgresql.org 03/03/05 22:16:56
>
> Modified files:
> . : configure configure.in
> src/include : pg_config.h.in
> src/interfaces/libpq: fe-misc.c
>
> Log message:
> Use poll(2) in preference to select(2), if available. This solves
> problems in applications that may have a large number of files open,
> such that libpq's socket number exceeds the range supported by fd_set.
> From Chris Brown.