--- IO-AIO/AIO.pm 2011/07/07 22:36:18 1.203 +++ IO-AIO/AIO.pm 2011/07/18 03:09:06 1.205 @@ -170,7 +170,7 @@ use base 'Exporter'; BEGIN { - our $VERSION = '3.93'; + our $VERSION = '4.0'; 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 @@ -1806,14 +1806,33 @@ 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. +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 I IO::AIO before (or after) +forking. You could also try to call the L function in the +child: + +=over 4 + +=item 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 +C 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. + +=back =head2 MEMORY USAGE