ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/README
(Generate patch)

Comparing IO-AIO/README (file contents):
Revision 1.48 by root, Wed Jun 29 11:25:17 2011 UTC vs.
Revision 1.49 by root, Mon Jul 18 03:09:06 2011 UTC

168 aio_unlink $pathname, $callback->($status) 168 aio_unlink $pathname, $callback->($status)
169 aio_mknod $path, $mode, $dev, $callback->($status) 169 aio_mknod $path, $mode, $dev, $callback->($status)
170 aio_link $srcpath, $dstpath, $callback->($status) 170 aio_link $srcpath, $dstpath, $callback->($status)
171 aio_symlink $srcpath, $dstpath, $callback->($status) 171 aio_symlink $srcpath, $dstpath, $callback->($status)
172 aio_readlink $path, $callback->($link) 172 aio_readlink $path, $callback->($link)
173 aio_realpath $path, $callback->($link)
173 aio_rename $srcpath, $dstpath, $callback->($status) 174 aio_rename $srcpath, $dstpath, $callback->($status)
174 aio_mkdir $pathname, $mode, $callback->($status) 175 aio_mkdir $pathname, $mode, $callback->($status)
175 aio_rmdir $pathname, $callback->($status) 176 aio_rmdir $pathname, $callback->($status)
176 aio_readdir $pathname, $callback->($entries) 177 aio_readdir $pathname, $callback->($entries)
177 aio_readdirx $pathname, $flags, $callback->($entries, $flags) 178 aio_readdirx $pathname, $flags, $callback->($entries, $flags)
557 aio_readlink $path, $callback->($link) 558 aio_readlink $path, $callback->($link)
558 Asynchronously read the symlink specified by $path and pass it to 559 Asynchronously read the symlink specified by $path and pass it to
559 the callback. If an error occurs, nothing or undef gets passed to 560 the callback. If an error occurs, nothing or undef gets passed to
560 the callback. 561 the callback.
561 562
563 aio_realpath $path, $callback->($path)
564 Asynchronously make the path absolute and resolve any symlinks in
565 $path. The resulting path only consists of directories (Same as
566 Cwd::realpath).
567
568 This request can be used to get the absolute path of the current
569 working directory by passing it a path of . (a single dot).
570
562 aio_rename $srcpath, $dstpath, $callback->($status) 571 aio_rename $srcpath, $dstpath, $callback->($status)
563 Asynchronously rename the object at $srcpath to $dstpath, just as 572 Asynchronously rename the object at $srcpath to $dstpath, just as
564 rename(2) and call the callback with the result code. 573 rename(2) and call the callback with the result code.
565 574
566 aio_mkdir $pathname, $mode, $callback->($status) 575 aio_mkdir $pathname, $mode, $callback->($status)
1371 1380
1372 FORK BEHAVIOUR 1381 FORK BEHAVIOUR
1373 Usage of pthreads in a program changes the semantics of fork 1382 Usage of pthreads in a program changes the semantics of fork
1374 considerably. Specifically, only async-safe functions can be called 1383 considerably. Specifically, only async-safe functions can be called
1375 after fork. Perl doesn't know about this, so in general, you cannot call 1384 after fork. Perl doesn't know about this, so in general, you cannot call
1376 fork with defined behaviour in perl. IO::AIO uses pthreads, so this 1385 fork with defined behaviour in perl if pthreads are involved. IO::AIO
1377 applies, but many other extensions and (for inexplicable reasons) perl 1386 uses pthreads, so this applies, but many other extensions and (for
1378 itself often is linked against pthreads, so this limitation applies. 1387 inexplicable reasons) perl itself often is linked against pthreads, so
1388 this limitation applies to quite a lot of perls.
1379 1389
1380 Some operating systems have extensions that allow safe use of fork, and 1390 This module no longer tries to fight your OS, or POSIX. That means
1381 this module should do "the right thing" on those, and tries on others. 1391 IO::AIO only works in the process that loaded it. Forking is fully
1382 At the time of this writing (2011) only GNU/Linux supports these 1392 supported, but using IO::AIO in the child is not.
1383 extensions to POSIX. 1393
1394 You might get around by not *using* IO::AIO before (or after) forking.
1395 You could also try to call the IO::AIO::reinit function in the child:
1396
1397 IO::AIO::reinit
1398 Abondons all current requests and I/O threads and simply
1399 reinitialises all data structures. This is not an operation
1400 suppported by any standards, but happens to work on GNU/Linux and
1401 some newer BSD systems.
1402
1403 The only reasonable use for this function is to call it after
1404 forking, if "IO::AIO" was used in the parent. Calling it while
1405 IO::AIO is active in the process will result in undefined behaviour.
1406 Calling it at any time will also result in any undefined (by POSIX)
1407 behaviour.
1384 1408
1385 MEMORY USAGE 1409 MEMORY USAGE
1386 Per-request usage: 1410 Per-request usage:
1387 1411
1388 Each aio request uses - depending on your architecture - around 100-200 1412 Each aio request uses - depending on your architecture - around 100-200

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines