libev/README

82 lines
2.9 KiB
Plaintext
Raw Normal View History

2007-11-02 15:56:19 +00:00
libev is a high-performance event loop/event model with lots of features.
2007-11-01 17:35:02 +00:00
It is modelled (very losely) after libevent
(http://monkey.org/~provos/libevent/) and the Event perl module, but aims
to be faster and more correct, and also more featureful.
DIFFERENCES AND COMPARISON TO LIBEVENT:
2007-11-02 12:23:52 +00:00
(comparisons relative to libevent-1.3e and libev-0.00, see also the benchmark
at http://libev.schmorp.de/bench.html).
2007-10-31 07:45:55 +00:00
2007-10-31 00:24:16 +00:00
- multiple watchers can wait for the same event without deregistering others,
both for file descriptors as well as signals.
2007-10-30 23:10:33 +00:00
(registering two read events on fd 10 and unregistering one will not
2007-11-01 17:35:02 +00:00
break the other).
2007-10-30 23:10:33 +00:00
- fork() is supported and can be handled
2007-11-01 17:35:02 +00:00
(there is no way to recover from a fork when libevent is active).
2007-10-30 23:10:33 +00:00
2007-11-01 11:30:23 +00:00
- timers are handled as a priority queue (important operations are O(1))
2007-11-01 17:35:02 +00:00
(libevent uses a much less efficient but more complex red-black tree).
2007-10-30 23:10:33 +00:00
- supports absolute (wallclock-based) timers in addition to relative ones,
i.e. can schedule timers to occur after n seconds, or at a specific time.
2007-11-01 17:35:02 +00:00
- timers can be repeating (both absolute and relative ones).
2007-10-30 23:10:33 +00:00
- detects time jumps and adjusts timers
2007-11-01 17:35:02 +00:00
(works for both forward and backward time jumps and also for absolute timers).
2007-10-30 23:10:33 +00:00
2007-10-30 23:54:38 +00:00
- race-free signal processing
2007-11-01 17:35:02 +00:00
(libevent may delay processing signals till after the next event).
2007-10-30 23:54:38 +00:00
2007-10-30 23:10:33 +00:00
- less calls to epoll_ctl
(stopping and starting an io watcher between two loop iterations will now
2007-11-01 17:35:02 +00:00
result in spuriois epoll_ctl calls).
2007-10-30 23:10:33 +00:00
- usually less calls to gettimeofday and clock_gettime
2007-11-01 17:35:02 +00:00
(libevent calls it on every timer event change, libev twice per iteration).
2007-10-30 23:10:33 +00:00
- watchers use less memory
2007-11-01 17:35:02 +00:00
(libevent on amd64: 152 bytes, libev: <= 56 bytes).
2007-10-30 23:10:33 +00:00
- library uses less memory
(libevent allocates large data structures wether used or not, libev
2007-11-01 17:35:02 +00:00
scales all its data structures dynamically).
2007-10-30 23:10:33 +00:00
- no hardcoded arbitrary limits
(libevent contains an off-by-one bug and sometimes hardcodes a limit of
2007-11-01 17:35:02 +00:00
32000 fds).
2007-10-30 23:10:33 +00:00
- libev separates timer, signal and io watchers from each other
(libevent combines them, but with libev you can combine them yourself
2007-11-01 17:35:02 +00:00
by reusing the same callback and still save memory).
2007-10-30 23:10:33 +00:00
- simpler design, backends are potentially much simpler
(in libevent, backends have to deal with watchers, thus the problems)
2007-11-01 17:35:02 +00:00
(epoll backend in libevent: 366 lines, libev: 90 lines, and more features).
2007-10-30 23:10:33 +00:00
2007-10-31 18:28:00 +00:00
- libev handles EBADF gracefully by removing the offending fds.
2007-11-01 11:55:54 +00:00
- doesn't rely on nonportable BSD header files.
2007-11-01 17:35:02 +00:00
- a event.h compatibility header exists, and can be used to run a wide
range of libevent programs unchanged (such as evdns.c).
2007-11-06 16:51:20 +00:00
- win32 compatibility for the core parts.
- the event core library (ev and event layer) compiles and works both as
C and C++.
2007-10-30 23:10:33 +00:00
whats missing?
2007-11-01 17:35:02 +00:00
- evbuffer, evhttp, bufferevent are missing.
2007-10-30 23:10:33 +00:00
2007-11-01 17:35:02 +00:00
- no priority support at the moment (but likely to be delivered later).
2007-10-30 23:10:33 +00:00
2007-11-01 17:35:02 +00:00
- kqueue, poll (libev currently implements epoll and select).
2007-10-31 00:24:16 +00:00
2007-11-01 17:35:02 +00:00
- windows support (whats windows?).