… | |
… | |
6 | |
6 | |
7 | use Linux::AIO; |
7 | use Linux::AIO; |
8 | |
8 | |
9 | =head1 DESCRIPTION |
9 | =head1 DESCRIPTION |
10 | |
10 | |
11 | This module implements asynchronous i/o using the means available to linux |
11 | This module implements asynchronous I/O using the means available to Linux |
12 | - clone. It does not hook into the POSIX aio_* functions because linux |
12 | - clone. It does not hook into the POSIX aio_* functions because Linux |
13 | does not yet support these in the kernel (and even if, it would only allow |
13 | does not yet support these in the kernel (even as of 2.6.12, only O_DIRECT |
14 | aio_read and write, not open and stat). |
14 | files are supported) and even if, it would only allow aio_read and write, |
|
|
15 | not open, stat and so on. |
15 | |
16 | |
16 | Instead, in this module a number of (non-posix) threads are started that |
17 | Instead, in this module a number of (non-posix) threads are started that |
17 | execute your read/writes and signal their completion. You don't need |
18 | execute your read/writes and signal their completion. You don't need |
18 | thread support in your libc or perl, and the threads created by this |
19 | thread support in your libc or perl, and the threads created by this |
19 | module will not be visible to the pthreads library. |
20 | module will not be visible to the pthreads library. |
20 | |
21 | |
21 | NOTICE: the threads created by this module will automatically be killed |
22 | NOTICE: the threads created by this module will automatically be killed |
22 | when the thread calling min_parallel exits. Make sure you only ever call |
23 | when the thread calling min_parallel exits. Make sure you only ever call |
23 | min_parallel from the same thread that loaded this module. |
24 | min_parallel from the same thread that loaded this module. |
24 | |
25 | |
25 | Although the module will work with threads, it is not reentrant, so use |
26 | Although the module will work with in the presence of other threads, it is |
26 | appropriate locking yourself. |
27 | not reentrant, so use appropriate locking yourself. |
27 | |
28 | |
28 | =over 4 |
29 | =over 4 |
29 | |
30 | |
30 | =cut |
31 | =cut |
31 | |
32 | |