… | |
… | |
51 | |
51 | |
52 | This module implements asynchronous I/O using whatever means your |
52 | This module implements asynchronous I/O using whatever means your |
53 | operating system supports. |
53 | operating system supports. |
54 | |
54 | |
55 | Currently, a number of threads are started that execute your read/writes |
55 | Currently, a number of threads are started that execute your read/writes |
56 | and signal their completion. You don't need thread support in your libc or |
56 | and signal their completion. You don't need thread support in perl, and |
57 | perl, and the threads created by this module will not be visible to the |
57 | the threads created by this module will not be visible to perl. In the |
58 | pthreads library. In the future, this module might make use of the native |
58 | future, this module might make use of the native aio functions available |
59 | aio functions available on many operating systems. However, they are often |
59 | on many operating systems. However, they are often not well-supported |
60 | not well-supported (Linux doesn't allow them on normal files currently, |
60 | (Linux doesn't allow them on normal files currently, for example), |
61 | for example), and they would only support aio_read and aio_write, so the |
61 | and they would only support aio_read and aio_write, so the remaining |
62 | remaining functionality would have to be implemented using threads anyway. |
62 | functionality would have to be implemented using threads anyway. |
63 | |
63 | |
64 | Although the module will work with in the presence of other threads, it is |
64 | Although the module will work with in the presence of other threads, it is |
65 | currently not reentrant, so use appropriate locking yourself, always call |
65 | currently not reentrant, so use appropriate locking yourself, always call |
66 | C<poll_cb> from within the same thread, or never call C<poll_cb> (or other |
66 | C<poll_cb> from within the same thread, or never call C<poll_cb> (or other |
67 | C<aio_> functions) recursively. |
67 | C<aio_> functions) recursively. |
… | |
… | |
76 | use base 'Exporter'; |
76 | use base 'Exporter'; |
77 | |
77 | |
78 | BEGIN { |
78 | BEGIN { |
79 | our $VERSION = '2.0'; |
79 | our $VERSION = '2.0'; |
80 | |
80 | |
81 | our @EXPORT = qw(aio_sendfile aio_read aio_write aio_open aio_close aio_stat |
81 | our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close aio_stat |
82 | aio_lstat aio_unlink aio_rmdir aio_readdir aio_scandir aio_symlink |
82 | aio_lstat aio_unlink aio_rmdir aio_readdir aio_scandir aio_symlink |
83 | aio_fsync aio_fdatasync aio_readahead aio_rename aio_link aio_move |
83 | aio_fsync aio_fdatasync aio_readahead aio_rename aio_link aio_move |
84 | aio_group aio_nop); |
84 | aio_group aio_nop); |
85 | our @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel max_outstanding nreqs); |
85 | our @EXPORT = (@AIO_REQ, qw(aioreq_pri)); |
|
|
86 | our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush |
|
|
87 | min_parallel max_parallel max_outstanding nreqs); |
86 | |
88 | |
87 | @IO::AIO::GRP::ISA = 'IO::AIO::REQ'; |
89 | @IO::AIO::GRP::ISA = 'IO::AIO::REQ'; |
88 | |
90 | |
89 | require XSLoader; |
91 | require XSLoader; |
90 | XSLoader::load ("IO::AIO", $VERSION); |
92 | XSLoader::load ("IO::AIO", $VERSION); |