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

Comparing libev/ev.pod (file contents):
Revision 1.108 by root, Mon Dec 24 10:39:21 2007 UTC vs.
Revision 1.109 by root, Mon Dec 24 13:19:12 2007 UTC

983In general you can register as many read and/or write event watchers per 983In general you can register as many read and/or write event watchers per
984fd as you want (as long as you don't confuse yourself). Setting all file 984fd as you want (as long as you don't confuse yourself). Setting all file
985descriptors to non-blocking mode is also usually a good idea (but not 985descriptors to non-blocking mode is also usually a good idea (but not
986required if you know what you are doing). 986required if you know what you are doing).
987 987
988You have to be careful with dup'ed file descriptors, though. Some backends
989(the linux epoll backend is a notable example) cannot handle dup'ed file
990descriptors correctly if you register interest in two or more fds pointing
991to the same underlying file/socket/etc. description (that is, they share
992the same underlying "file open").
993
994If you must do this, then force the use of a known-to-be-good backend 988If you must do this, then force the use of a known-to-be-good backend
995(at the time of this writing, this includes only C<EVBACKEND_SELECT> and 989(at the time of this writing, this includes only C<EVBACKEND_SELECT> and
996C<EVBACKEND_POLL>). 990C<EVBACKEND_POLL>).
997 991
998Another thing you have to watch out for is that it is quite easy to 992Another thing you have to watch out for is that it is quite easy to
1033 1027
1034=head3 The special problem of dup'ed file descriptors 1028=head3 The special problem of dup'ed file descriptors
1035 1029
1036Some backends (e.g. epoll), cannot register events for file descriptors, 1030Some backends (e.g. epoll), cannot register events for file descriptors,
1037but only events for the underlying file descriptions. That means when you 1031but only events for the underlying file descriptions. That means when you
1038have C<dup ()>'ed file descriptors and register events for them, only one 1032have C<dup ()>'ed file descriptors or weirder constellations, and register
1039file descriptor might actually receive events. 1033events for them, only one file descriptor might actually receive events.
1040 1034
1041There is no workaround possible except not registering events 1035There is no workaround possible except not registering events
1042for potentially C<dup ()>'ed file descriptors, or to resort to 1036for potentially C<dup ()>'ed file descriptors, or to resort to
1043C<EVBACKEND_SELECT> or C<EVBACKEND_POLL>. 1037C<EVBACKEND_SELECT> or C<EVBACKEND_POLL>.
1044 1038

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines