libevent is meant to replace the event loop found in event driven network servers. An application just needs to call event_dispatch() and then add or remove events dynamically without having to change the event loop.
Currently, libevent supports /dev/poll, kqueue(2), event ports, POSIX select(2), Windows select(), poll(2), and epoll(4). The internal event mechanism is completely independent of the exposed event API, and a simple update of libevent can provide new functionality without having to redesign the applications. As a result, Libevent allows for portable application development and provides the most scalable event notification mechanism available on an operating system. Libevent can also be used for multi-threaded applications, either by isolating each event_base so that only a single thread accesses it, or by locked access to a single shared event_base. Libevent should compile on Linux, *BSD, Mac OS X, Solaris, Windows, and more.
Libevent additionally provides a sophisticated framework for buffered network IO, with support for sockets, filters, rate-limiting, SSL, zero-copy file transmission, and IOCP. Libevent includes support for several useful protocols, including DNS, HTTP, and a minimal RPC framework.
More information about event notification mechanisms for network servers can be found on Dan Kegel's "The C10K problem" web page.
DocumentationBook: Programming with Libevent.
Reference: 1.4.x-stable 2.0.x-stable 2.1.x-stable master
ABI/API compatibility report: releases master
What's new in: 2.0.x-stable 2.1.x-alpha.
These are the ones you probably want for software development, unless you like to track the latest development versions and report bugs in them.
Download release candidates
This is a release candidate. If you find any bugs, please let us know!
This is alpha code. If you find any bugs, please let us know!
BenchmarkPerformance comparison using different event notification mechansims in Libevent. We declare interest in a large number of connections of which most are cold and only a few are active.
Programs using libeventThe usefulness of libevent API is demonstrated by the following applications: