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

Comparing IO-AIO/AIO.pm (file contents):
Revision 1.182 by root, Sun Sep 12 03:36:27 2010 UTC vs.
Revision 1.183 by root, Sun Sep 12 03:40:05 2010 UTC

1128and sets errno to C<ENOSYS>. 1128and sets errno to C<ENOSYS>.
1129 1129
1130Note that the corresponding C<munlock> is synchronous and is 1130Note that the corresponding C<munlock> is synchronous and is
1131documented under L<MISCELLANEOUS FUNCTIONS>. 1131documented under L<MISCELLANEOUS FUNCTIONS>.
1132 1132
1133Example: open a file, mmap and mlock it - both will be undone when
1134C<$data> gets destroyed.
1135
1136 open my $fh, "<", $path or die "$path: $!";
1137 my $data;
1138 IO::AIO::mmap $data, -s $fh, IO::AIO::PROT_READ, IO::AIO::MAP_SHARED, $fh;
1139 aio_mlock $data; # mlock in background
1140
1133=item aio_mlockall $flags, $callback->($status) 1141=item aio_mlockall $flags, $callback->($status)
1134 1142
1135Calls the C<mlockall> function with the given C<$flags> (a combination of 1143Calls the C<mlockall> function with the given C<$flags> (a combination of
1136C<IO::AIO::MCL_CURRENT> and C<IO::AIO::MCL_FUTURE>). 1144C<IO::AIO::MCL_CURRENT> and C<IO::AIO::MCL_FUTURE>).
1137 1145
1138On systems that do not implement C<mlockall>, this function returns C<-1> 1146On systems that do not implement C<mlockall>, this function returns C<-1>
1139and sets errno to C<ENOSYS>. 1147and sets errno to C<ENOSYS>.
1140 1148
1141Note that the corresponding C<munlockall> is synchronous and is 1149Note that the corresponding C<munlockall> is synchronous and is
1142documented under L<MISCELLANEOUS FUNCTIONS>. 1150documented under L<MISCELLANEOUS FUNCTIONS>.
1151
1152Example: asynchronously lock all current and future pages into memory.
1153
1154 aio_mlockall IO::AIO::MCL_FUTURE;
1143 1155
1144=item aio_group $callback->(...) 1156=item aio_group $callback->(...)
1145 1157
1146This is a very special aio request: Instead of doing something, it is a 1158This is a very special aio request: Instead of doing something, it is a
1147container for other aio requests, which is useful if you want to bundle 1159container for other aio requests, which is useful if you want to bundle

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines