--- libev/ev.html 2007/11/23 05:14:58 1.32 +++ libev/ev.html 2007/11/23 08:36:35 1.33 @@ -6,7 +6,7 @@ - + @@ -230,6 +230,9 @@ (because the fd could point to a different file description now), so its best to avoid that. Also, dup()ed file descriptors might not work very well if you register events for both fds.

+

Please note that epoll sometimes generates spurious notifications, so you +need to use non-blocking I/O or other means to avoid blocking when no data +(or space) is available.

EVBACKEND_KQUEUE (value 8, most BSD clones)
@@ -252,6 +255,9 @@

This uses the Solaris 10 port mechanism. As with everything on Solaris, it's really slow, but it still scales very well (O(active_fds)).

+

Please note that solaris ports can result in a lot of spurious +notifications, so you need to use non-blocking I/O or other means to avoid +blocking when no data (or space) is available.

EVBACKEND_ALL
@@ -550,6 +556,16 @@

Configures an ev_io watcher. The fd is the file descriptor to rceeive events for and events is either EV_READ, EV_WRITE or EV_READ | EV_WRITE to receive the given events.

+

Please note that most of the more scalable backend mechanisms (for example +epoll and solaris ports) can result in spurious readyness notifications +for file descriptors, so you practically need to use non-blocking I/O (and +treat callback invocation as hint only), or retest separately with a safe +interface before doing I/O (XLib can do this), or force the use of either +EVBACKEND_SELECT or EVBACKEND_POLL, which don't suffer from this +problem. Also note that it is quite easy to have your callback invoked +when the readyness condition is no longer valid even when employing +typical ways of handling events, so its a good idea to use non-blocking +I/O unconditionally.