… | |
… | |
874 | This module automatically runs C<max_parallel 0> at program end, to ensure |
874 | This module automatically runs C<max_parallel 0> at program end, to ensure |
875 | that all threads are killed and that there are no outstanding requests. |
875 | that all threads are killed and that there are no outstanding requests. |
876 | |
876 | |
877 | Under normal circumstances you don't need to call this function. |
877 | Under normal circumstances you don't need to call this function. |
878 | |
878 | |
879 | =item $oldnreqs = IO::AIO::max_outstanding $nreqs |
879 | =item $oldmaxreqs = IO::AIO::max_outstanding $maxreqs |
880 | |
880 | |
881 | [REMOVED] |
881 | This is a very bad function to use in interactive programs because it |
|
|
882 | blocks, and a bad way to reduce concurrency because it is inexact: Better |
|
|
883 | use an C<aio_group> together with a feed callback. |
882 | |
884 | |
883 | Pre-2.x versions used max_outstanding for a crude request queue length limit. |
|
|
884 | |
|
|
885 | In 2.x+ you are advised to use a group and a feeder to limit |
|
|
886 | concurrency. The max_outstanding feature ran very unstable (endless |
|
|
887 | recursions causing segfaults, bad interaction with groups etc.) and was |
|
|
888 | removed. |
|
|
889 | |
|
|
890 | I am deeply sorry, but I am still on the hunt for a good limiting interface. |
|
|
891 | |
|
|
892 | Original description was as follows: |
|
|
893 | |
|
|
894 | Sets the maximum number of outstanding requests to C<$nreqs>. If you try |
885 | Sets the maximum number of outstanding requests to C<$nreqs>. If you |
895 | to queue up more than this number of requests, the caller will block until |
886 | to queue up more than this number of requests, the next call to the |
896 | some requests have been handled. |
887 | C<poll_cb> (and C<poll_some> and other functions calling C<poll_cb>) |
|
|
888 | function will block until the limit is no longer exceeded. |
|
|
889 | |
|
|
890 | The default value is very large, so there is no practical limit on the |
|
|
891 | number of outstanding requests. |
|
|
892 | |
|
|
893 | You can still queue as many requests as you want. Therefore, |
|
|
894 | C<max_oustsanding> is mainly useful in simple scripts (with low values) or |
|
|
895 | as a stop gap to shield against fatal memory overflow (with large values). |
897 | |
896 | |
898 | =back |
897 | =back |
899 | |
898 | |
900 | =cut |
899 | =cut |
901 | |
900 | |