--- IO-AIO/README 2011/06/29 11:25:17 1.48 +++ IO-AIO/README 2011/07/18 03:09:06 1.49 @@ -170,6 +170,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) @@ -559,6 +560,14 @@ the callback. If an error occurs, nothing or undef gets passed to the callback. + aio_realpath $path, $callback->($path) + Asynchronously make the path absolute and resolve any symlinks in + $path. The resulting path only consists of directories (Same as + Cwd::realpath). + + This request can be used to get the absolute path of the current + working directory by passing it a path of . (a single dot). + aio_rename $srcpath, $dstpath, $callback->($status) Asynchronously rename the object at $srcpath to $dstpath, just as rename(2) and call the callback with the result code. @@ -1373,14 +1382,29 @@ 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. + fork with defined behaviour in perl if pthreads are involved. 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 to quite a lot of perls. + + This module no longer tries to fight your OS, or POSIX. That means + IO::AIO only works in the process that loaded it. Forking is fully + supported, but using IO::AIO in the child is not. + + You might get around by not *using* IO::AIO before (or after) forking. + You could also try to call the IO::AIO::reinit function in the child: + + IO::AIO::reinit + Abondons all current requests and I/O threads and simply + reinitialises all data structures. This is not an operation + suppported by any standards, but happens to work on GNU/Linux and + some newer BSD systems. + + The only reasonable use for this function is to call it after + forking, if "IO::AIO" was used in the parent. Calling it while + IO::AIO is active in the process will result in undefined behaviour. + Calling it at any time will also result in any undefined (by POSIX) + behaviour. MEMORY USAGE Per-request usage: