--- IO-AIO/AIO.pm 2005/07/10 20:07:11 1.3 +++ IO-AIO/AIO.pm 2005/07/10 20:57:00 1.4 @@ -55,7 +55,7 @@ @EXPORT = qw(aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink aio_fsync aio_fdatasync aio_readahead); - @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs); + @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel max_outstanding nreqs); require XSLoader; XSLoader::load IO::AIO, $VERSION; @@ -67,12 +67,14 @@ C<1>, which means a single asynchronous operation can be done at one time (the number of outstanding operations, however, is unlimited). -It is recommended to keep the number of threads low, as some linux +It is recommended to keep the number of threads low, as some Linux kernel versions will scale negatively with the number of threads (higher -parallelity => MUCH higher latency). +parallelity => MUCH higher latency). With current Linux 2.6 versions, 4-32 +threads should be fine. Under normal circumstances you don't need to call this function, as this -module automatically starts a single async thread. +module automatically starts some threads (the exact number might change, +and is currently 4). =item IO::AIO::max_parallel $nthreads @@ -85,6 +87,18 @@ Under normal circumstances you don't need to call this function. +=item $oldnreqs = IO::AIO::max_outstanding $nreqs + +Sets the maximum number of outstanding requests to C<$nreqs>. If you +try to queue up more than this number of requests, the caller will block until +some requests have been handled. + +The default is very large, so normally there is no practical limit. If you +queue up many requests in a loop it it often improves speed if you set +this to a relatively low number, such as C<100>. + +Under normal circumstances you don't need to call this function. + =item $fileno = IO::AIO::poll_fileno Return the I. This filehandle must be