It is still work in progress!
Linux async I/O implementation is still work-in-progress and there's no perfect solution.
There are other solutions:
- check out Polyakov's work (not developed anymore)
- check out POSIX aio for Linux
- check out eventfd
- check out Suparna's patches
Also, buffered AIO is still to be done! That's right! Everything you read on Linux, using O_DIRECT is unbuffered.
Fortunatley, it seems to be possible to use eventfd with AIO, see here. C example included in our trunk.
It still can block!
io_submit - the procedure called by Queue.schedule functions (Queue.scheduleRead, for example) can be blocking.
When?
- file is not opened with os.O_DIRECT flag
- output data buffer is not page-aligned
- you run out of block layer requests: ``` You don't mention what hardware you are running this on (the disk sub system). io_submit() will block, if you run out of block layer requests. We have 128 of those by default, but if your io ends up getting chopped into somewhat smaller bits than 1MiB each, then you end up having to block on allocation of those. So lets say your /src is mounted on /dev/sdaX, try:
echo 512 > /sys/block/sda/queue/nr_requests
```
-- found here. * also this: ```
On Linux, there is a system-wide limit of the maximum number of parallel KAIO requests. The /proc/sys/fs/aio-max-nr file contains this value. The Linux system administrator can increase the value, for example, by using this command:
echo new_value > /proc/sys/fs/aio-max-nr
```