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.11 by root, Mon Jul 11 00:51:32 2005 UTC vs.
Revision 1.16 by root, Mon Jul 11 03:10:08 2005 UTC

22 poll => 'r', 22 poll => 'r',
23 cb => \&IO::AIO::poll_cb); 23 cb => \&IO::AIO::poll_cb);
24 24
25 # Glib/Gtk2 25 # Glib/Gtk2
26 add_watch Glib::IO IO::AIO::poll_fileno, 26 add_watch Glib::IO IO::AIO::poll_fileno,
27 \&IO::AIO::poll_cb; 27 in => sub { IO::AIO::poll_cb, 1 };
28 28
29 # Tk 29 # Tk
30 Tk::Event::IO->fileevent (IO::AIO::poll_fileno, "", 30 Tk::Event::IO->fileevent (IO::AIO::poll_fileno, "",
31 readable => \&IO::AIO::poll_cb); 31 readable => \&IO::AIO::poll_cb);
32 32
75 75
76=head2 AIO FUNCTIONS 76=head2 AIO FUNCTIONS
77 77
78All the C<aio_*> calls are more or less thin wrappers around the syscall 78All the C<aio_*> calls are more or less thin wrappers around the syscall
79with the same name (sans C<aio_>). The arguments are similar or identical, 79with the same name (sans C<aio_>). The arguments are similar or identical,
80and they all accept an additional C<$callback> argument which must be 80and they all accept an additional (and optional) C<$callback> argument
81a code reference. This code reference will get called with the syscall 81which must be a code reference. This code reference will get called with
82return code (e.g. most syscalls return C<-1> on error, unlike perl, which 82the syscall return code (e.g. most syscalls return C<-1> on error, unlike
83usually delivers "false") as it's sole argument when the given syscall has 83perl, which usually delivers "false") as it's sole argument when the given
84been executed asynchronously. 84syscall has been executed asynchronously.
85 85
86All functions that expect a filehandle will also accept a file descriptor. 86All functions that expect a filehandle will also accept a file descriptor.
87 87
88The filenames you pass to these routines I<must> be absolute. The reason 88The filenames you pass to these routines I<must> be absolute. The reason
89is that at the time the request is being executed, the current working 89is that at the time the request is being executed, the current working
233Example: wait till there are no outstanding requests anymore: 233Example: wait till there are no outstanding requests anymore:
234 234
235 IO::AIO::poll_wait, IO::AIO::poll_cb 235 IO::AIO::poll_wait, IO::AIO::poll_cb
236 while IO::AIO::nreqs; 236 while IO::AIO::nreqs;
237 237
238=item IO::AIO::flush
239
240Wait till all outstanding AIO requests have been handled.
241
242Strictly equivalent to:
243
244 IO::AIO::poll_wait, IO::AIO::poll_cb
245 while IO::AIO::nreqs;
246
247=item IO::AIO::poll
248
249Waits until some requests have been handled.
250
251Strictly equivalent to:
252
253 IO::AIO::poll_wait, IO::AIO::poll_cb
254 if IO::AIO::nreqs;
255
238=item IO::AIO::min_parallel $nthreads 256=item IO::AIO::min_parallel $nthreads
239 257
240Set the minimum number of AIO threads to C<$nthreads>. The default is 258Set the minimum number of AIO threads to C<$nthreads>. The default is
241C<1>, which means a single asynchronous operation can be done at one time 259C<1>, which means a single asynchronous operation can be done at one time
242(the number of outstanding operations, however, is unlimited). 260(the number of outstanding operations, however, is unlimited).

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines