--- IO-AIO/AIO.pm 2010/09/12 03:36:27 1.182 +++ IO-AIO/AIO.pm 2010/09/12 03:40:05 1.183 @@ -1130,6 +1130,14 @@ Note that the corresponding C is synchronous and is documented under L. +Example: open a file, mmap and mlock it - both will be undone when +C<$data> gets destroyed. + + open my $fh, "<", $path or die "$path: $!"; + my $data; + IO::AIO::mmap $data, -s $fh, IO::AIO::PROT_READ, IO::AIO::MAP_SHARED, $fh; + aio_mlock $data; # mlock in background + =item aio_mlockall $flags, $callback->($status) Calls the C function with the given C<$flags> (a combination of @@ -1141,6 +1149,10 @@ Note that the corresponding C is synchronous and is documented under L. +Example: asynchronously lock all current and future pages into memory. + + aio_mlockall IO::AIO::MCL_FUTURE; + =item aio_group $callback->(...) This is a very special aio request: Instead of doing something, it is a