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.169 by root, Sat Jan 2 13:02:20 2010 UTC vs.
Revision 1.170 by root, Sat Jan 2 14:11:32 2010 UTC

199 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx 199 aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx
200 aio_scandir aio_symlink aio_readlink aio_sync aio_fsync 200 aio_scandir aio_symlink aio_readlink aio_sync aio_fsync
201 aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead 201 aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead
202 aio_rename aio_link aio_move aio_copy aio_group 202 aio_rename aio_link aio_move aio_copy aio_group
203 aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown 203 aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown
204 aio_chmod aio_utime aio_truncate); 204 aio_chmod aio_utime aio_truncate
205 aio_msync aio_mtouch);
205 206
206 our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); 207 our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice));
207 our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush 208 our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush
208 min_parallel max_parallel max_idle 209 min_parallel max_parallel max_idle
209 nreqs nready npending nthreads 210 nreqs nready npending nthreads
380 381
381This call tries to make use of a native C<sendfile> syscall to provide 382This call tries to make use of a native C<sendfile> syscall to provide
382zero-copy operation. For this to work, C<$out_fh> should refer to a 383zero-copy operation. For this to work, C<$out_fh> should refer to a
383socket, and C<$in_fh> should refer to mmap'able file. 384socket, and C<$in_fh> should refer to mmap'able file.
384 385
385If the native sendfile call fails with C<ENOSYS>, C<ENOTSUP>, 386If a native sendfile cannot be found or it fails with C<ENOSYS>,
386C<EOPNOTSUPP> or C<ENOTSOCK>, or is not implemented, it will be emulated, 387C<ENOTSUP>, C<EOPNOTSUPP>, C<EAFNOSUPPORT>, C<EPROTOTYPE> or C<ENOTSOCK>,
387so you can call C<aio_sendfile> on any type of filehandle regardless of 388it will be emulated, so you can call C<aio_sendfile> on any type of
388the limitations of the operating system. 389filehandle regardless of the limitations of the operating system.
389 390
390Please note, however, that C<aio_sendfile> can read more bytes from 391Please note, however, that C<aio_sendfile> can read more bytes from
391C<$in_fh> than are written, and there is no way to find out how many 392C<$in_fh> than are written, and there is no way to find out how many
392bytes have been read from C<aio_sendfile> alone, as C<aio_sendfile> only 393bytes have been read from C<aio_sendfile> alone, as C<aio_sendfile> only
393provides the number of bytes written to C<$out_fh>. Only if the result 394provides the number of bytes written to C<$out_fh>. Only if the result
990 }; 991 };
991 992
992 $grp 993 $grp
993} 994}
994 995
996=item aio_msync $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status)
997
998This is a rather advanced IO::AIO call, which only works on mmap(2)ed
999scalars (see the L<Sys::Mmap> or L<Mmap> modules for details on this, note
1000that the scalar must only be modified in-place while an aio operation is
1001pending on it).
1002
1003It calls the C<msync> function of your OS, if available, with the memory
1004area starting at C<$offset> in the string and ending C<$length> bytes
1005later. If C<$length> is negative, counts from the end, and if C<$length>
1006is C<undef>, then it goes till the end of the string. The flags can be
1007a combination of C<IO::AIO::MS_ASYNC>, C<IO::AIO::MS_INVALIDATE> and
1008C<IO::AIO::MS_SYNC>.
1009
1010=item aio_mtouch $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status)
1011
1012This is a rather advanced IO::AIO call, which works best on mmap(2)ed
1013scalars.
1014
1015It touches (reads or writes) all memory pages in the specified
1016range inside the scalar. All caveats and parameters are the same
1017as for C<aio_msync>, above, except for flags, which must be either
1018C<0> (which reads all pages and ensures they are instantiated) or
1019C<IO::AIO::MT_MODIFY>, which modifies the memory page s(by reading and
1020writing an octet from it, which dirties the page).
1021
995=item aio_group $callback->(...) 1022=item aio_group $callback->(...)
996 1023
997This is a very special aio request: Instead of doing something, it is a 1024This is a very special aio request: Instead of doing something, it is a
998container for other aio requests, which is useful if you want to bundle 1025container for other aio requests, which is useful if you want to bundle
999many requests into a single, composite, request with a definite callback 1026many requests into a single, composite, request with a definite callback

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines