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.15 by root, Thu May 6 12:16:48 2004 UTC vs.
Revision 1.16 by root, Thu May 6 15:05:57 2004 UTC

16Instead, in this module a number of (non-posix) threads are started that 16Instead, in this module a number of (non-posix) threads are started that
17execute your read/writes and signal their completion. You don't need 17execute your read/writes and signal their completion. You don't need
18thread support in your libc or perl, and the threads created by this 18thread support in your libc or perl, and the threads created by this
19module will not be visible to the pthreads library. 19module will not be visible to the pthreads library.
20 20
21Although the module will work with threads, it is not reentrant, so use
22appropriate locking yourself.
23
21=over 4 24=over 4
22 25
23=cut 26=cut
24 27
25package Linux::AIO; 28package Linux::AIO;
26 29
27use base 'Exporter'; 30use base 'Exporter';
28 31
29BEGIN { 32BEGIN {
30 $VERSION = 1.01; 33 $VERSION = 1.1;
31 34
32 @EXPORT = qw(aio_read aio_write aio_open aio_close aio_stat aio_lstat); 35 @EXPORT = qw(aio_read aio_write aio_open aio_close aio_stat aio_lstat);
33 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs); 36 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs);
34 37
35 require XSLoader; 38 require XSLoader;
36 XSLoader::load Linux::AIO, $VERSION; 39 XSLoader::load Linux::AIO, $VERSION;
37} 40}
38 41
39=item Linux::AIO::min_parallel $nthreads 42=item Linux::AIO::min_parallel $nthreads
40 43
41Set the minimum number of AIO threads to C<$nthreads>. You I<have> to call 44Set the minimum number of AIO threads to C<$nthreads>. The default is
42this function with a positive number at least once, otherwise no threads 45C<1>, which means a single asynchronous operation can be done at one time
43will be started and you aio-operations will seem to hang. 46(the number of outstanding operations, however, is unlimited).
44 47
45It is recommended to keep the number of threads low, as many linux 48It is recommended to keep the number of threads low, as many linux
46kernel versions will scale negatively with the number of threads (higher 49kernel versions will scale negatively with the number of threads (higher
47parallelity => MUCH higher latency). 50parallelity => MUCH higher latency).
48 51
100error when stat'ing a large file, the results will be silently truncated 103error when stat'ing a large file, the results will be silently truncated
101unless perl itself is compiled with large file support. 104unless perl itself is compiled with large file support.
102 105
103=cut 106=cut
104 107
108min_parallel 1;
109
105END { 110END {
106 max_parallel 0; 111 max_parallel 0;
107} 112}
108 113
1091; 1141;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines