--- IO-AIO/AIO.pm 2011/06/10 06:50:42 1.196 +++ IO-AIO/AIO.pm 2011/06/29 11:25:17 1.198 @@ -170,7 +170,7 @@ use base 'Exporter'; BEGIN { - our $VERSION = '3.9'; + our $VERSION = '3.91'; 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 @@ -1791,19 +1791,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