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

Comparing Linux-AIO/AIO.pm (file contents):
Revision 1.1 by root, Tue Aug 14 03:18:53 2001 UTC vs.
Revision 1.2 by root, Tue Aug 14 18:06:37 2001 UTC

12 12
13=cut 13=cut
14 14
15package Linux::AIO; 15package Linux::AIO;
16 16
17use base 'Exporter';
18
17BEGIN { 19BEGIN {
18 $VERSION = 0.001; 20 $VERSION = 0.001;
21
22 @EXPORT = qw(aio_read aio_write);
23 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs);
19 24
20 require XSLoader; 25 require XSLoader;
21 XSLoader::load Linux::AIO, $VERSION; 26 XSLoader::load Linux::AIO, $VERSION;
22} 27}
23
24use base 'Exporter';
25 28
26=item Linux::AIO::min_parallel($nthreads) 29=item Linux::AIO::min_parallel($nthreads)
27 30
28Set the minimum number of AIO threads to $nthreads. 31Set the minimum number of AIO threads to $nthreads.
29 32
30=cut 33=cut
31 34
32=item Linux::AIO::read($fh,$offset,$length, $data,$dataoffset,$callback) 35=item aio_read($fh,$offset,$length, $data,$dataoffset,$callback)
33Linux::AIO::write($fh,$offset,$length, $data,$dataoffset,$callback) 36aio_write($fh,$offset,$length, $data,$dataoffset,$callback)
34 37
35Reads or writes C<length> bytes from the specified C<fh> and C<offset> 38Reads or writes C<length> bytes from the specified C<fh> and C<offset>
36into the scalar given by C<data> and offset C<dataoffset> and calls the 39into the scalar given by C<data> and offset C<dataoffset> and calls the
37callback without the actual number of bytes read (or undef on error). 40callback without the actual number of bytes read (or undef on error).
38 41
42=item $fileno = Linux::AIO::poll_fileno
43
44Return the request result pipe filehandle. This filehandle must be polled
45for reading. If the pipe becomes readable you have to call C<poll_cb>.
46
47=item Linux::AIO::poll_cb
48
49Process all outstanding events on the result pipe. You have to call this
50regularly. Returns the number of events processed.
51
52=item Linux::AIO::nreqs
53
54Returns the number of requests currently outstanding.
55
39=cut 56=cut
57
58END {
59 max_parallel 0;
60}
40 61
411; 621;
42 63
43=back 64=back
44 65

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines