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.206 by root, Sun Jul 24 03:32:51 2011 UTC vs.
Revision 1.208 by root, Mon Sep 26 20:19:08 2011 UTC

179 aio_pathsync aio_readahead 179 aio_pathsync aio_readahead
180 aio_rename aio_link aio_move aio_copy aio_group 180 aio_rename aio_link aio_move aio_copy aio_group
181 aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown 181 aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown
182 aio_chmod aio_utime aio_truncate 182 aio_chmod aio_utime aio_truncate
183 aio_msync aio_mtouch aio_mlock aio_mlockall 183 aio_msync aio_mtouch aio_mlock aio_mlockall
184 aio_statvfs); 184 aio_statvfs
185 aio_wd);
185 186
186 our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice)); 187 our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice));
187 our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush 188 our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush
188 min_parallel max_parallel max_idle idle_timeout 189 min_parallel max_parallel max_idle idle_timeout
189 nreqs nready npending nthreads 190 nreqs nready npending nthreads
205 206
206This section simply lists the prototypes of the most important functions 207This section simply lists the prototypes of the most important functions
207for quick reference. See the following sections for function-by-function 208for quick reference. See the following sections for function-by-function
208documentation. 209documentation.
209 210
211 aio_wd $pathname, $callback->($wd)
210 aio_open $pathname, $flags, $mode, $callback->($fh) 212 aio_open $pathname, $flags, $mode, $callback->($fh)
211 aio_close $fh, $callback->($status) 213 aio_close $fh, $callback->($status)
212 aio_read $fh,$offset,$length, $data,$dataoffset, $callback->($retval) 214 aio_read $fh,$offset,$length, $data,$dataoffset, $callback->($retval)
213 aio_write $fh,$offset,$length, $data,$dataoffset, $callback->($retval) 215 aio_write $fh,$offset,$length, $data,$dataoffset, $callback->($retval)
214 aio_sendfile $out_fh, $in_fh, $in_offset, $length, $callback->($retval) 216 aio_sendfile $out_fh, $in_fh, $in_offset, $length, $callback->($retval)
687array-ref with the filenames. 689array-ref with the filenames.
688 690
689 691
690=item aio_readdirx $pathname, $flags, $callback->($entries, $flags) 692=item aio_readdirx $pathname, $flags, $callback->($entries, $flags)
691 693
692Quite similar to C<aio_readdir>, but the C<$flags> argument allows to tune 694Quite similar to C<aio_readdir>, but the C<$flags> argument allows one to
693behaviour and output format. In case of an error, C<$entries> will be 695tune behaviour and output format. In case of an error, C<$entries> will be
694C<undef>. 696C<undef>.
695 697
696The flags are a combination of the following constants, ORed together (the 698The flags are a combination of the following constants, ORed together (the
697flags will also be passed to the callback, possibly modified): 699flags will also be passed to the callback, possibly modified):
698 700
745 747
746=item IO::AIO::READDIR_FOUND_UNKNOWN 748=item IO::AIO::READDIR_FOUND_UNKNOWN
747 749
748This flag should not be set when calling C<aio_readdirx>. Instead, it 750This flag should not be set when calling C<aio_readdirx>. Instead, it
749is being set by C<aio_readdirx>, when any of the C<$type>'s found were 751is being set by C<aio_readdirx>, when any of the C<$type>'s found were
750C<IO::AIO::DT_UNKNOWN>. The absense of this flag therefore indicates that all 752C<IO::AIO::DT_UNKNOWN>. The absence of this flag therefore indicates that all
751C<$type>'s are known, which can be used to speed up some algorithms. 753C<$type>'s are known, which can be used to speed up some algorithms.
752 754
753=back 755=back
754 756
755 757
937Then entries will be sorted into likely directories a non-initial dot 939Then entries will be sorted into likely directories a non-initial dot
938currently) and likely non-directories (see C<aio_readdirx>). Then every 940currently) and likely non-directories (see C<aio_readdirx>). Then every
939entry plus an appended C</.> will be C<stat>'ed, likely directories first, 941entry plus an appended C</.> will be C<stat>'ed, likely directories first,
940in order of their inode numbers. If that succeeds, it assumes that the 942in order of their inode numbers. If that succeeds, it assumes that the
941entry is a directory or a symlink to directory (which will be checked 943entry is a directory or a symlink to directory (which will be checked
942seperately). This is often faster than stat'ing the entry itself because 944separately). This is often faster than stat'ing the entry itself because
943filesystems might detect the type of the entry without reading the inode 945filesystems might detect the type of the entry without reading the inode
944data (e.g. ext2fs filetype feature), even on systems that cannot return 946data (e.g. ext2fs filetype feature), even on systems that cannot return
945the filetype information on readdir. 947the filetype information on readdir.
946 948
947If the known number of directories (link count - 2) has been reached, the 949If the known number of directories (link count - 2) has been reached, the
1673 1675
1674=item IO::AIO::fadvise $fh, $offset, $len, $advice 1676=item IO::AIO::fadvise $fh, $offset, $len, $advice
1675 1677
1676Simply calls the C<posix_fadvise> function (see its 1678Simply calls the C<posix_fadvise> function (see its
1677manpage for details). The following advice constants are 1679manpage for details). The following advice constants are
1678avaiable: C<IO::AIO::FADV_NORMAL>, C<IO::AIO::FADV_SEQUENTIAL>, 1680available: C<IO::AIO::FADV_NORMAL>, C<IO::AIO::FADV_SEQUENTIAL>,
1679C<IO::AIO::FADV_RANDOM>, C<IO::AIO::FADV_NOREUSE>, 1681C<IO::AIO::FADV_RANDOM>, C<IO::AIO::FADV_NOREUSE>,
1680C<IO::AIO::FADV_WILLNEED>, C<IO::AIO::FADV_DONTNEED>. 1682C<IO::AIO::FADV_WILLNEED>, C<IO::AIO::FADV_DONTNEED>.
1681 1683
1682On systems that do not implement C<posix_fadvise>, this function returns 1684On systems that do not implement C<posix_fadvise>, this function returns
1683ENOSYS, otherwise the return value of C<posix_fadvise>. 1685ENOSYS, otherwise the return value of C<posix_fadvise>.
1684 1686
1685=item IO::AIO::madvise $scalar, $offset, $len, $advice 1687=item IO::AIO::madvise $scalar, $offset, $len, $advice
1686 1688
1687Simply calls the C<posix_madvise> function (see its 1689Simply calls the C<posix_madvise> function (see its
1688manpage for details). The following advice constants are 1690manpage for details). The following advice constants are
1689avaiable: C<IO::AIO::MADV_NORMAL>, C<IO::AIO::MADV_SEQUENTIAL>, 1691available: C<IO::AIO::MADV_NORMAL>, C<IO::AIO::MADV_SEQUENTIAL>,
1690C<IO::AIO::MADV_RANDOM>, C<IO::AIO::MADV_WILLNEED>, C<IO::AIO::MADV_DONTNEED>. 1692C<IO::AIO::MADV_RANDOM>, C<IO::AIO::MADV_WILLNEED>, C<IO::AIO::MADV_DONTNEED>.
1691 1693
1692On systems that do not implement C<posix_madvise>, this function returns 1694On systems that do not implement C<posix_madvise>, this function returns
1693ENOSYS, otherwise the return value of C<posix_madvise>. 1695ENOSYS, otherwise the return value of C<posix_madvise>.
1694 1696
1695=item IO::AIO::mprotect $scalar, $offset, $len, $protect 1697=item IO::AIO::mprotect $scalar, $offset, $len, $protect
1696 1698
1697Simply calls the C<mprotect> function on the preferably AIO::mmap'ed 1699Simply calls the C<mprotect> function on the preferably AIO::mmap'ed
1698$scalar (see its manpage for details). The following protect 1700$scalar (see its manpage for details). The following protect
1699constants are avaiable: C<IO::AIO::PROT_NONE>, C<IO::AIO::PROT_READ>, 1701constants are available: C<IO::AIO::PROT_NONE>, C<IO::AIO::PROT_READ>,
1700C<IO::AIO::PROT_WRITE>, C<IO::AIO::PROT_EXEC>. 1702C<IO::AIO::PROT_WRITE>, C<IO::AIO::PROT_EXEC>.
1701 1703
1702On systems that do not implement C<mprotect>, this function returns 1704On systems that do not implement C<mprotect>, this function returns
1703ENOSYS, otherwise the return value of C<mprotect>. 1705ENOSYS, otherwise the return value of C<mprotect>.
1704 1706
1829 1831
1830=over 4 1832=over 4
1831 1833
1832=item IO::AIO::reinit 1834=item IO::AIO::reinit
1833 1835
1834Abondons all current requests and I/O threads and simply reinitialises all 1836Abandons all current requests and I/O threads and simply reinitialises all
1835data structures. This is not an operation suppported by any standards, but 1837data structures. This is not an operation supported by any standards, but
1836happens to work on GNU/Linux and some newer BSD systems. 1838happens to work on GNU/Linux and some newer BSD systems.
1837 1839
1838The only reasonable use for this function is to call it after forking, if 1840The only reasonable use for this function is to call it after forking, if
1839C<IO::AIO> was used in the parent. Calling it while IO::AIO is active in 1841C<IO::AIO> was used in the parent. Calling it while IO::AIO is active in
1840the process will result in undefined behaviour. Calling it at any time 1842the process will result in undefined behaviour. Calling it at any time

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines