Mirror of :pserver:anonymous@cvs.schmorp.de/schmorpforge libev http://software.schmorp.de/pkg/libev.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
4.9 KiB

14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
  1. libev is a high-performance event loop/event model with lots of features.
  2. (see benchmark at http://libev.schmorp.de/bench.html)
  3. Homepage: http://software.schmorp.de/pkg/libev
  4. E-Mail: libev@lists.schmorp.de
  5. It is modelled (very losely) after libevent
  6. (http://monkey.org/~provos/libevent/) and the Event perl module, but aims
  7. to be faster and more correct, and also more featureful.
  8. ABOUT THIS DISTRIBUTION
  9. If you downloaded a distribution of libev, you will find it looks
  10. very much like libevent. In fact, the distributed libev tarballs are
  11. indeed libevent tarballs patched up with the libev event core, taking
  12. the evbuffer, evtag, evdns and evhttpd parts from libevent (they use
  13. the libevent emulation inside libev). Configure and Makefile stuff is
  14. also a more or less direct copy of libevent, and are maintained by the
  15. libevent authors.
  16. If you are looking for an easily embeddable version, I recommend using
  17. the CVS repository (linked from the homepage, above), which contains
  18. only the libev core parts.
  19. Examples of programs that embed libev: the EV perl module,
  20. rxvt-unicode, gvpe (GNU Virtual Private Ethernet) and deliantra
  21. (http://www.deliantra.net).
  22. DIFFERENCES AND COMPARISON TO LIBEVENT
  23. The comparisons below are relative to libevent-1.3e.
  24. - multiple watchers can wait for the same event without deregistering others,
  25. both for file descriptors as well as signals.
  26. (registering two read events on fd 10 and unregistering one will not
  27. break the other).
  28. - fork() is supported and can be handled
  29. (there is no way to recover from a fork with libevent).
  30. - timers are handled as a priority queue (important operations are O(1))
  31. (libevent uses a much less efficient but more complex red-black tree).
  32. - supports absolute (wallclock-based) timers in addition to relative ones,
  33. i.e. can schedule timers to occur after n seconds, or at a specific time.
  34. - timers can be repeating (both absolute and relative ones).
  35. - absolute timers can have customised rescheduling hooks (suitable for cron-like
  36. applications).
  37. - detects time jumps and adjusts timers
  38. (works for both forward and backward time jumps and also for absolute timers).
  39. - race-free signal processing
  40. (libevent may delay processing signals till after the next event).
  41. - more efficient epoll backend
  42. (stopping and starting an io watcher between two loop iterations will not
  43. result in spurious epoll_ctl calls).
  44. - usually less calls to gettimeofday and clock_gettime
  45. (libevent calls it on every timer event change, libev twice per iteration).
  46. - watchers use less memory
  47. (libevent watcher on amd64: 152 bytes, libev native: <= 56 bytes, libevent emulation: 144 bytes).
  48. - library uses less memory
  49. (libevent allocates large data structures wether used or not, libev
  50. scales all its data structures dynamically).
  51. - no hardcoded arbitrary limits
  52. (libevent contains an off-by-one bug and sometimes hardcodes limits).
  53. - libev separates timer, signal and io watchers from each other
  54. (libevent combines them, but with libev you can combine them yourself
  55. by reusing the same callback and still save memory).
  56. - simpler design, backends are potentially much simpler
  57. (in libevent, backends have to deal with watchers, thus the problems with
  58. wildly different semantics between diferent backends)
  59. (epoll backend in libevent: 366 lines no caching, libev: 90 lines full caching).
  60. - libev handles EBADF gracefully by removing the offending fds.
  61. - libev communicates errors to the callback, libevent to the
  62. event adder or not at all.
  63. - doesn't rely on nonportable BSD header files.
  64. - an event.h compatibility header exists, and can be used to run a wide
  65. range of libevent programs unchanged (such as evdns.c).
  66. - win32 compatibility for the core parts.
  67. (the backend is fd-based as documented and on other platforms,
  68. not handle-based like libevent, and can be used for both winscoket environments
  69. and unix-like ones).
  70. - libev can be embedded easily with or without autoconf support into
  71. other programs, with no changes to the source code necessary.
  72. - the event core library (ev and event layer) compiles and works both as
  73. C and C++.
  74. - a simple C++ wrapper that supports methods as callbacks exists.
  75. - a full featured and widely used perl module is available.
  76. whats missing?
  77. - no event-like priority support at the moment (the ev priorities work
  78. differently, but you can use idle watchers to get a similar effect).
  79. AUTHOR
  80. libev was written and designed by Marc Lehmann and Emanuele Giaquinta.
  81. The following people sent in patches or made other noteworthy
  82. contributions to the design (if I forgot to include you, please shout
  83. at me, it was an accident):
  84. W.C.A. Wijngaards
  85. Christopher Layne
  86. Chris Brody