1 |
=head1 NAME |
2 |
|
3 |
Linux::AIO - linux-specific aio implemented using clone |
4 |
|
5 |
=head1 SYNOPSIS |
6 |
|
7 |
use Linux::AIO; |
8 |
|
9 |
=head1 DESCRIPTION |
10 |
|
11 |
=over 4 |
12 |
|
13 |
=cut |
14 |
|
15 |
package Linux::AIO; |
16 |
|
17 |
BEGIN { |
18 |
$VERSION = 0.001; |
19 |
|
20 |
require XSLoader; |
21 |
XSLoader::load Linux::AIO, $VERSION; |
22 |
} |
23 |
|
24 |
use base 'Exporter'; |
25 |
|
26 |
=item Linux::AIO::min_parallel($nthreads) |
27 |
|
28 |
Set the minimum number of AIO threads to $nthreads. |
29 |
|
30 |
=cut |
31 |
|
32 |
=item Linux::AIO::read($fh,$offset,$length, $data,$dataoffset,$callback) |
33 |
Linux::AIO::write($fh,$offset,$length, $data,$dataoffset,$callback) |
34 |
|
35 |
Reads or writes C<length> bytes from the specified C<fh> and C<offset> |
36 |
into the scalar given by C<data> and offset C<dataoffset> and calls the |
37 |
callback without the actual number of bytes read (or undef on error). |
38 |
|
39 |
=cut |
40 |
|
41 |
1; |
42 |
|
43 |
=back |
44 |
|
45 |
=head1 BUGS |
46 |
|
47 |
This module has not yet been extensively tested. Watch out! |
48 |
|
49 |
This module does not use the aio_* posix functions because a) linux does |
50 |
not have aio, b) the existing aio_* functions use pthreads, which are too |
51 |
buggy for my usage. |
52 |
|
53 |
=head1 SEE ALSO |
54 |
|
55 |
L<Coro>. |
56 |
|
57 |
=head1 AUTHOR |
58 |
|
59 |
Marc Lehmann <pcg@goof.com> |
60 |
http://www.goof.com/pcg/marc/ |
61 |
|
62 |
=cut |
63 |
|