Wed, 06 Feb 2008
Event Library
For a distributed computing project of mine I have been looking for
a lightweight library for event-driven programming. For Perl,
I have found EV
(with EV::Watcher::Bind
add-on). Now the question is
what to use for C.
I have decided to not use
glib
, because it is too
heavyweight (with its own object system, etc.). The next choice was
libev
, because this is what
the perl EV
module is based on. And another one was
libevent
, which is
already included in Fedora. Both
libev
and libevent
are still being actively
developed.
The most interesting thing is probably that in the
libev
documentation
the author says that the glorified kqueue
API on *BSD is broken
on most *BSDs (scroll down to the EVBACKEND_KQUEUE
text).
I will probably use libev
: it even provides an API-compatible
wrapper to libevent
-based applications (does anybody know whether
it is also ABI-compatible?), and according to its author, it is
faster than libevent,
even when using the libevent
API wrapper. For further reading
on why an advanced kernel API is needed instead of select(2)
or poll(2)
see The C10k
problem article.