ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/README
(Generate patch)

Comparing libev/README (file contents):
Revision 1.8 by root, Thu Nov 1 11:55:54 2007 UTC vs.
Revision 1.11 by root, Fri Nov 2 15:56:19 2007 UTC

1libev is modelled (very losely) after libevent 1libev is a high-performance event loop/event model with lots of features.
2(http://monkey.org/~provos/libevent/), but aims to be faster and more
3correct, and also more featureful. Examples:
4 2
3It is modelled (very losely) after libevent
4(http://monkey.org/~provos/libevent/) and the Event perl module, but aims
5to be faster and more correct, and also more featureful.
6
7DIFFERENCES AND COMPARISON TO LIBEVENT:
8
5(comparisons relative to libevent-1.3e and libev-0.00) 9(comparisons relative to libevent-1.3e and libev-0.00, see also the benchmark
10at http://libev.schmorp.de/bench.html).
6 11
7- multiple watchers can wait for the same event without deregistering others, 12- multiple watchers can wait for the same event without deregistering others,
8 both for file descriptors as well as signals. 13 both for file descriptors as well as signals.
9 (registering two read events on fd 10 and unregistering one will not 14 (registering two read events on fd 10 and unregistering one will not
10 break the other) 15 break the other).
11 16
12- fork() is supported and can be handled 17- fork() is supported and can be handled
13 (there is no way to recover from a fork when libevent is active) 18 (there is no way to recover from a fork when libevent is active).
14 19
15- timers are handled as a priority queue (important operations are O(1)) 20- timers are handled as a priority queue (important operations are O(1))
16 (libevent uses a much less efficient but more complex red-black tree) 21 (libevent uses a much less efficient but more complex red-black tree).
17 22
18- supports absolute (wallclock-based) timers in addition to relative ones, 23- supports absolute (wallclock-based) timers in addition to relative ones,
19 i.e. can schedule timers to occur after n seconds, or at a specific time. 24 i.e. can schedule timers to occur after n seconds, or at a specific time.
20 25
21- timers can be repeating (both absolute and relative ones) 26- timers can be repeating (both absolute and relative ones).
22 27
23- detects time jumps and adjusts timers 28- detects time jumps and adjusts timers
24 (works for both forward and backward time jumps and also for absolute timers) 29 (works for both forward and backward time jumps and also for absolute timers).
25 30
26- can correctly remove timers while executing callbacks 31- can correctly remove timers while executing callbacks
27 (libevent doesn't handle this reliably and can crash) 32 (libevent doesn't handle this reliably and can crash).
28 33
29- race-free signal processing 34- race-free signal processing
30 (libevent may delay processing signals till after the next event) 35 (libevent may delay processing signals till after the next event).
31 36
32- less calls to epoll_ctl 37- less calls to epoll_ctl
33 (stopping and starting an io watcher between two loop iterations will now 38 (stopping and starting an io watcher between two loop iterations will now
34 result in spuriois epoll_ctl calls) 39 result in spuriois epoll_ctl calls).
35 40
36- usually less calls to gettimeofday and clock_gettime 41- usually less calls to gettimeofday and clock_gettime
37 (libevent calls it on every timer event change, libev twice per iteration) 42 (libevent calls it on every timer event change, libev twice per iteration).
38 43
39- watchers use less memory 44- watchers use less memory
40 (libevent on amd64: 152 bytes, libev: <= 56 bytes) 45 (libevent on amd64: 152 bytes, libev: <= 56 bytes).
41 46
42- library uses less memory 47- library uses less memory
43 (libevent allocates large data structures wether used or not, libev 48 (libevent allocates large data structures wether used or not, libev
44 scales all its data structures dynamically) 49 scales all its data structures dynamically).
45 50
46- no hardcoded arbitrary limits 51- no hardcoded arbitrary limits
47 (libevent contains an off-by-one bug and sometimes hardcodes a limit of 52 (libevent contains an off-by-one bug and sometimes hardcodes a limit of
48 32000 fds) 53 32000 fds).
49 54
50- libev separates timer, signal and io watchers from each other 55- libev separates timer, signal and io watchers from each other
51 (libevent combines them, but with libev you can combine them yourself 56 (libevent combines them, but with libev you can combine them yourself
52 by reusing the same callback and still save memory) 57 by reusing the same callback and still save memory).
53 58
54- simpler design, backends are potentially much simpler 59- simpler design, backends are potentially much simpler
55 (in libevent, backends have to deal with watchers, thus the problems) 60 (in libevent, backends have to deal with watchers, thus the problems)
56 (epoll backend in libevent: 366 lines, libev: 90 lines, and more features) 61 (epoll backend in libevent: 366 lines, libev: 90 lines, and more features).
57 62
58- libev handles EBADF gracefully by removing the offending fds. 63- libev handles EBADF gracefully by removing the offending fds.
59 64
60- doesn't rely on nonportable BSD header files. 65- doesn't rely on nonportable BSD header files.
61 66
67- a event.h compatibility header exists, and can be used to run a wide
68 range of libevent programs unchanged (such as evdns.c).
69
62whats missing? 70whats missing?
63 71
64- evdns, evhttp, bufferevent are missing, libev is only an even library at 72- evbuffer, evhttp, bufferevent are missing.
65 the moment.
66 73
67- no priority support at the moment 74- no priority support at the moment (but likely to be delivered later).
68 75
69- kqueue, poll (libev currently implements epoll and select) 76- kqueue, poll (libev currently implements epoll and select).
70 77
71- windows support (whats windows?) 78- windows support (whats windows?).
72 79

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines