ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.pm
(Generate patch)

Comparing IO-AIO/AIO.pm (file contents):
Revision 1.88 by root, Sun Oct 29 01:50:29 2006 UTC vs.
Revision 1.89 by root, Sun Oct 29 11:03:18 2006 UTC

939that are being processed by C<IO::AIO::poll_cb> in one call, respectively 939that are being processed by C<IO::AIO::poll_cb> in one call, respectively
940the maximum amount of time (default C<0>, meaning infinity) spent in 940the maximum amount of time (default C<0>, meaning infinity) spent in
941C<IO::AIO::poll_cb> to process requests (more correctly the mininum amount 941C<IO::AIO::poll_cb> to process requests (more correctly the mininum amount
942of time C<poll_cb> is allowed to use). 942of time C<poll_cb> is allowed to use).
943 943
944Setting C<max_poll_time> to a non-zero value creates an overhead of one
945syscall per request processed, which is not normally a problem unless your
946callbacks are really really fast or your OS is really really slow (I am
947not mentioning Solaris here). Using C<max_poll_reqs> incurs no overhead.
948
944Setting these is useful if you want to ensure some level of 949Setting these is useful if you want to ensure some level of
945interactiveness when perl is not fast enough to process all requests in 950interactiveness when perl is not fast enough to process all requests in
946time. 951time.
947 952
948For interactive programs, values such as C<0.01> to C<0.1> should be fine. 953For interactive programs, values such as C<0.01> to C<0.1> should be fine.
949 954
950Example: Install an Event watcher that automatically calls 955Example: Install an Event watcher that automatically calls
951IO::AIO::poll_some with low priority, to ensure that other parts of the 956IO::AIO::poll_cb with low priority, to ensure that other parts of the
952program get the CPU sometimes even under high AIO load. 957program get the CPU sometimes even under high AIO load.
953 958
954 # try not to spend much more than 0.1s in poll_cb 959 # try not to spend much more than 0.1s in poll_cb
955 IO::AIO::max_poll_time 0.1; 960 IO::AIO::max_poll_time 0.1;
956 961

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines