Various implementations of Unix offer high-performance, scalable replacements for these system calls, e.g. /dev/poll, kqueue(), /dev/epoll, and Linux's realtime signal readiness notification, all with significantly different interfaces. This makes them difficult to learn, and makes it hard to write portable code.
Poller is an interface that provides a common abstraction for all of these readiness notification schemes. New readiness notification schemes can be supported by writing a new subclass of Poller.
Poller is currently supplied as part of dkftpbench. To use it, download, unpack, configure, make, and install dkftpbench as usual (this takes about two minutes).
In source that create Pollers, you currently need to include each of the subclasses you want to use, e.g. to get them all, you'd say
#include <dkftpbench/Poller_devpoll.h> #include <dkftpbench/Poller_kqueue.h> #include <dkftpbench/Poller_poll.h> #include <dkftpbench/Poller_select.h> #include <dkftpbench/Poller_sigfd.h> #include <dkftpbench/Poller_sigio.h>Source that just uses references to already-created Pollers can simply include the base class:
#include <dkftpbench/Poller.h>Then link with
Three programs that use Poller might be useful as examples: