… | |
… | |
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 | |
381 | This call tries to make use of a native C<sendfile> syscall to provide |
382 | This call tries to make use of a native C<sendfile> syscall to provide |
382 | zero-copy operation. For this to work, C<$out_fh> should refer to a |
383 | zero-copy operation. For this to work, C<$out_fh> should refer to a |
383 | socket, and C<$in_fh> should refer to mmap'able file. |
384 | socket, and C<$in_fh> should refer to mmap'able file. |
384 | |
385 | |
385 | If the native sendfile call fails with C<ENOSYS>, C<ENOTSUP>, |
386 | If a native sendfile cannot be found or it fails with C<ENOSYS>, |
386 | C<EOPNOTSUPP> or C<ENOTSOCK>, or is not implemented, it will be emulated, |
387 | C<ENOTSUP>, C<EOPNOTSUPP>, C<EAFNOSUPPORT>, C<EPROTOTYPE> or C<ENOTSOCK>, |
387 | so you can call C<aio_sendfile> on any type of filehandle regardless of |
388 | it will be emulated, so you can call C<aio_sendfile> on any type of |
388 | the limitations of the operating system. |
389 | filehandle regardless of the limitations of the operating system. |
389 | |
390 | |
390 | Please note, however, that C<aio_sendfile> can read more bytes from |
391 | Please note, however, that C<aio_sendfile> can read more bytes from |
391 | C<$in_fh> than are written, and there is no way to find out how many |
392 | C<$in_fh> than are written, and there is no way to find out how many |
392 | bytes have been read from C<aio_sendfile> alone, as C<aio_sendfile> only |
393 | bytes have been read from C<aio_sendfile> alone, as C<aio_sendfile> only |
393 | provides the number of bytes written to C<$out_fh>. Only if the result |
394 | provides 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 | |
|
|
998 | This is a rather advanced IO::AIO call, which only works on mmap(2)ed |
|
|
999 | scalars (see the L<Sys::Mmap> or L<Mmap> modules for details on this, note |
|
|
1000 | that the scalar must only be modified in-place while an aio operation is |
|
|
1001 | pending on it). |
|
|
1002 | |
|
|
1003 | It calls the C<msync> function of your OS, if available, with the memory |
|
|
1004 | area starting at C<$offset> in the string and ending C<$length> bytes |
|
|
1005 | later. If C<$length> is negative, counts from the end, and if C<$length> |
|
|
1006 | is C<undef>, then it goes till the end of the string. The flags can be |
|
|
1007 | a combination of C<IO::AIO::MS_ASYNC>, C<IO::AIO::MS_INVALIDATE> and |
|
|
1008 | C<IO::AIO::MS_SYNC>. |
|
|
1009 | |
|
|
1010 | =item aio_mtouch $scalar, $offset = 0, $length = undef, flags = 0, $callback->($status) |
|
|
1011 | |
|
|
1012 | This is a rather advanced IO::AIO call, which works best on mmap(2)ed |
|
|
1013 | scalars. |
|
|
1014 | |
|
|
1015 | It touches (reads or writes) all memory pages in the specified |
|
|
1016 | range inside the scalar. All caveats and parameters are the same |
|
|
1017 | as for C<aio_msync>, above, except for flags, which must be either |
|
|
1018 | C<0> (which reads all pages and ensures they are instantiated) or |
|
|
1019 | C<IO::AIO::MT_MODIFY>, which modifies the memory page s(by reading and |
|
|
1020 | writing an octet from it, which dirties the page). |
|
|
1021 | |
995 | =item aio_group $callback->(...) |
1022 | =item aio_group $callback->(...) |
996 | |
1023 | |
997 | This is a very special aio request: Instead of doing something, it is a |
1024 | This is a very special aio request: Instead of doing something, it is a |
998 | container for other aio requests, which is useful if you want to bundle |
1025 | container for other aio requests, which is useful if you want to bundle |
999 | many requests into a single, composite, request with a definite callback |
1026 | many requests into a single, composite, request with a definite callback |