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.156 by root, Tue Jun 16 23:41:59 2009 UTC vs.
Revision 1.158 by root, Wed Jun 17 06:33:07 2009 UTC

192use strict 'vars'; 192use strict 'vars';
193 193
194use base 'Exporter'; 194use base 'Exporter';
195 195
196BEGIN { 196BEGIN {
197 our $VERSION = '3.23'; 197 our $VERSION = '3.25';
198 198
199 our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close 199 our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close
200 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx 200 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx
201 aio_scandir aio_symlink aio_readlink aio_sync aio_fsync 201 aio_scandir aio_symlink aio_readlink aio_sync aio_fsync
202 aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead 202 aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead
206 206
207 our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); 207 our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice));
208 our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush 208 our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush
209 min_parallel max_parallel max_idle 209 min_parallel max_parallel max_idle
210 nreqs nready npending nthreads 210 nreqs nready npending nthreads
211 max_poll_time max_poll_reqs); 211 max_poll_time max_poll_reqs
212 sendfile fadvise);
212 213
213 push @AIO_REQ, qw(aio_busy); # not exported 214 push @AIO_REQ, qw(aio_busy); # not exported
214 215
215 @IO::AIO::GRP::ISA = 'IO::AIO::REQ'; 216 @IO::AIO::GRP::ISA = 'IO::AIO::REQ';
216 217
1394Returns the number of requests currently in the pending state (executed, 1395Returns the number of requests currently in the pending state (executed,
1395but not yet processed by poll_cb). 1396but not yet processed by poll_cb).
1396 1397
1397=back 1398=back
1398 1399
1400=head3 MISCELLANEOUS FUNCTIONS
1401
1402IO::AIO implements some functions that might be useful, but are not
1403asynchronous.
1404
1405=over 4
1406
1407=item IO::AIO::sendfile $ofh, $ifh, $offset, $count
1408
1409Calls the C<eio_sendfile_sync> function, which is like C<aio_sendfile>,
1410but is blocking (this makes most sense if you know the input data is
1411likely cached already and the output filehandle is set to non-blocking
1412operations).
1413
1414Returns the number of bytes copied, or C<-1> on error.
1415
1416=item IO::AIO::fadvise $fh, $offset, $len, $advice
1417
1418Simply calls the C<posix_fadvise> function (see it's
1419manpage for details). The following advice constants are
1420avaiable: C<IO::AIO::FADV_NORMAL>, C<IO::AIO::FADV_SEQUENTIAL>,
1421C<IO::AIO::FADV_RANDOM>, C<IO::AIO::FADV_NOREUSE>,
1422C<IO::AIO::FADV_WILLNEED>, C<IO::AIO::FADV_DONTNEED>.
1423
1424On systems that do not implement C<posix_fadvise>, this function returns
1425ENOSYS, otherwise the return value of C<posix_fadvise>.
1426
1427=back
1428
1399=cut 1429=cut
1400 1430
1401min_parallel 8; 1431min_parallel 8;
1402 1432
1403END { flush } 1433END { flush }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines