--- IO-AIO/AIO.pm 2011/06/10 06:50:42 1.196 +++ IO-AIO/AIO.pm 2011/07/05 14:02:15 1.202 @@ -170,11 +170,11 @@ use base 'Exporter'; BEGIN { - our $VERSION = '3.9'; + our $VERSION = '3.93'; our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx - aio_scandir aio_symlink aio_readlink aio_sync aio_fsync + aio_scandir aio_symlink aio_readlink aio_realpath aio_sync aio_fsync aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead aio_rename aio_link aio_move aio_copy aio_group aio_nop aio_mknod aio_load aio_rmtree aio_mkdir aio_chown @@ -224,6 +224,7 @@ aio_link $srcpath, $dstpath, $callback->($status) aio_symlink $srcpath, $dstpath, $callback->($status) aio_readlink $path, $callback->($link) + aio_realpath $path, $callback->($link) aio_rename $srcpath, $dstpath, $callback->($status) aio_mkdir $pathname, $mode, $callback->($status) aio_rmdir $pathname, $callback->($status) @@ -645,6 +646,16 @@ callback. +=item aio_realpath $path, $callback->($path) + +Asynchronously make the path absolute and resolve any symlinks in +C<$path>. The resulting path only consists of directories (Same as +L). + +This request can be used to get the absolute path of the current working +directory by passing it a path of F<.> (a single dot). + + =item aio_rename $srcpath, $dstpath, $callback->($status) Asynchronously rename the object at C<$srcpath> to C<$dstpath>, just as @@ -1791,19 +1802,17 @@ =head2 FORK BEHAVIOUR -This module should do "the right thing" when the process using it forks: - -Before the fork, IO::AIO enters a quiescent state where no requests -can be added in other threads and no results will be processed. After -the fork the parent simply leaves the quiescent state and continues -request/result processing, while the child frees the request/result queue -(so that the requests started before the fork will only be handled in the -parent). Threads will be started on demand until the limit set in the -parent process has been reached again. - -In short: the parent will, after a short pause, continue as if fork had -not been called, while the child will act as if IO::AIO has not been used -yet. +Usage of pthreads in a program changes the semantics of fork +considerably. Specifically, only async-safe functions can be called after +fork. Perl doesn't know about this, so in general, you cannot call fork +with defined behaviour in perl. IO::AIO uses pthreads, so this applies, +but many other extensions and (for inexplicable reasons) perl itself often +is linked against pthreads, so this limitation applies. + +Some operating systems have extensions that allow safe use of fork, and +this module should do "the right thing" on those, and tries on others. At +the time of this writing (2011) only GNU/Linux supports these extensions +to POSIX. =head2 MEMORY USAGE