--- IO-AIO/AIO.pm 2006/10/24 17:22:17 1.74 +++ IO-AIO/AIO.pm 2006/10/25 17:57:30 1.77 @@ -136,7 +136,7 @@ aio_group aio_nop); our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush - min_parallel max_parallel max_outstanding nreqs); + min_parallel max_parallel nreqs); @IO::AIO::GRP::ISA = 'IO::AIO::REQ'; @@ -428,9 +428,9 @@ =item aio_scandir $path, $maxreq, $callback->($dirs, $nondirs) Scans a directory (similar to C) but additionally tries to -separate the entries of directory C<$path> into two sets of names, ones -you can recurse into (directories or links to them), and ones you cannot -recurse into (everything else). +efficiently separate the entries of directory C<$path> into two sets of +names, directories you can recurse into (directories), and ones you cannot +recurse into (everything else, including symlinks to directories). C is a composite request that creates of many sub requests_ C<$maxreq> specifies the maximum number of outstanding aio requests that @@ -540,9 +540,9 @@ if (-d _) { push @dirs, $entry; - if (!--$ndirs) { + unless (--$ndirs) { push @nondirs, @$entries; - $statgrp->cancel_subs; + feed $statgrp; } } else { push @nondirs, $entry; @@ -684,10 +684,6 @@ =item * You must not add requests to a group from within the group callback (or any later time). -=item * This does not harmonise well with C, so best do -not combine C with it. Groups and feeders are recommended for -this kind of concurrency-limiting. - =back Their lifetime, simplified, looks like this: when they are empty, they @@ -863,21 +859,22 @@ =item $oldnreqs = IO::AIO::max_outstanding $nreqs -[DEPRECATED] +[REMOVED] -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. +Pre-2.x versions used max_outstanding for a crude request queue length limit. -The default is very large, so normally there is no practical limit. If you -queue up many requests in a loop it often improves speed if you set -this to a relatively low number, such as C<100>. - -This function does not work well together with C's, and their -feeder interface is better suited to limiting concurrency, so do not use -this function. +In 2.x+ you are advised to use a group and a feeder to limit +concurrency. The max_outstanding feature ran very unstable (endless +recursions causing segfaults, bad interaction with groups etc.) and was +removed. -Under normal circumstances you don't need to call this function. +I am deeply sorry, but I am still on the hunt for a good limiting interface. + +Original description was as follows: + +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. =back