Welcome to the Event Library home page. This is a place-holder until I or someone else can come up with a better page. This page is also intended to give you an idea of the history and goals of this project. For a better idea of what is happening, you may wish to take a look at the current documentation.
Note: This project was conceived and named prior to my awareness of Niels Provos's libevent project...even though it has taken far longer for me to actually write working code! As SourceForge does not provide an easy way to rename projects, I have opted not to change my project's name at this time, despite the potential for confusion. My libevent will differ from Niels's in that it will use edge-triggered notification and that it will have a number of other useful features, including network abstraction. It will also have some companion libraries--resolvers, data buffering, and so on. Hopefully, that'll be value-added over Niels's libevent :)
-Kev
This project grew out of IRC server development for the Undernet. The Undernet is an IRC network with 30-someodd servers and a peak user count of around 98,000 users. This means that each server carries an enormous number of clients, and each client takes up a TCP connection. In the early IRC servers, this was handled by means of a loop built around the select(2) system call. At some point during the development of Undernet's IRC server, it was pointed out that the poll(2) call is more efficient on some systems, so a second loop, based on that system call, was written.
Neither the select(2) nor the poll(2) call is all that efficient, however. Other people, whose primary focus was on web servers, started to consider the problems that crop up due to using that many sockets, and more efficient alternatives were developed, as documented at http://www.kegel.com/c10k.html. During the development of the Undernet ircu2.10.11 server release, the core network loop was replaced by a version that could make use of two of these alternatives: FreeBSD's kernel queues and Solaris's /dev/poll. This new version of Undernet's core network loop was based on an event-driven model: When sockets become readable, an event structure is created and an event handler is called. Because detection of signals and timed events were also traditionally handled in the select loop, these also became entangled with the event system.
The purpose of this project is to take this event system implemented for Undernet's IRC server and create a library that may be used by anyone. This library is to be sufficiently general to permit operation with any network event detection system, including systems based on realtime signals. The library must provide conversion of signals and timers to events, as well as detecting events on sockets and possibly pipes. In addition, some programs may need to use threading, and the event model certainly lends itself to efficient processing by a work group of threads, so the resulting library is to use this technique as an option--though threading must not be required for use of the library. This lends added complexity to the structure of the library, but should be well worth the effort.
This project was originally conceived by Kevin L. Mitchell, and much of the basic architecture has already been developed. Also on this web site are documents regarding the coding style to be adhered to and the basic architecture of the library.