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