1 | libev is modelled after libevent (http://monkey.org/~provos/libevent/), but aims |
1 | libev is modelled after libevent (http://monkey.org/~provos/libevent/), but aims |
2 | to be faster and more correct, and also more featureful. Examples: |
2 | to be faster and more correct, and also more featureful. Examples: |
3 | |
3 | |
|
|
4 | (comparisons relative to libevent-1.3e and libev-0.00) |
|
|
5 | |
4 | - multiple watchers can wait for the same event without deregistering others. |
6 | - multiple watchers can wait for the same event without deregistering others, |
|
|
7 | both for file descriptors as well as signals. |
5 | (registering two read events on fd 10 and unregistering one will not |
8 | (registering two read events on fd 10 and unregistering one will not |
6 | break the other) |
9 | break the other) |
7 | |
10 | |
8 | - fork() is supported and can be handled |
11 | - fork() is supported and can be handled |
9 | (there is no way to recover from a fork when libevent is active) |
12 | (there is no way to recover from a fork when libevent is active) |
… | |
… | |
19 | - detects time jumps and adjusts timers |
22 | - detects time jumps and adjusts timers |
20 | (works for both forward and backward time jumps and also for absolute timers) |
23 | (works for both forward and backward time jumps and also for absolute timers) |
21 | |
24 | |
22 | - can correctly remove timers while executing callbacks |
25 | - can correctly remove timers while executing callbacks |
23 | (libevent doesn't handle this reliably and can crash) |
26 | (libevent doesn't handle this reliably and can crash) |
|
|
27 | |
|
|
28 | - race-free signal processing |
|
|
29 | (libevent may delay processing signals till after the next event) |
24 | |
30 | |
25 | - less calls to epoll_ctl |
31 | - less calls to epoll_ctl |
26 | (stopping and starting an io watcher between two loop iterations will now |
32 | (stopping and starting an io watcher between two loop iterations will now |
27 | result in spuriois epoll_ctl calls) |
33 | result in spuriois epoll_ctl calls) |
28 | |
34 | |
… | |
… | |
44 | (libevent combines them, but with libev you can combine them yourself |
50 | (libevent combines them, but with libev you can combine them yourself |
45 | by reusing the same callback and still save memory) |
51 | by reusing the same callback and still save memory) |
46 | |
52 | |
47 | - simpler design, backends are potentially much simpler |
53 | - simpler design, backends are potentially much simpler |
48 | (in libevent, backends have to deal with watchers, thus the problems) |
54 | (in libevent, backends have to deal with watchers, thus the problems) |
49 | (epoll backend in libevent: 366 lines, libev: 89 lines, and more features) |
55 | (epoll backend in libevent: 366 lines, libev: 90 lines, and more features) |
50 | |
56 | |
51 | whats missing? |
57 | whats missing? |
52 | |
58 | |
53 | - evdns, evhttp, bufferevent are missing, libev is only an even library at |
59 | - evdns, evhttp, bufferevent are missing, libev is only an even library at |
54 | the moment. |
60 | the moment. |
55 | |
61 | |
56 | - no priority support at the moment. |
62 | - no priority support at the moment |
57 | |
63 | |
58 | - kqueue, poll (libev currently implements epoll and select). |
64 | - kqueue, poll (libev currently implements epoll and select) |
59 | |
65 | |
|
|
66 | - windows support (whats windows?) |
|
|
67 | |