Is there asynchronous file i/o in Android NDK?

2019-07-24 21:43发布

I had to save/load a lot of data stored at the sdcard in my C++ android-ndk code. However, I was told that there is no async file IO <aio.h> in Android NDK, is that right?

If so , can any of you give me an example (or guideline) of async read/write files in Android NDK? Thank you!

1条回答
时光不老,我们不散
2楼-- · 2019-07-24 22:43

You are correct, there is no AIO available in the latest Android NDK:

$ cd ~/android-ndk-r15/platforms/android-26
$ find . -type f -exec grep aiocb {} \;
$

What is your primary use? Asynchronized reading or writing? You may have to roll your own solution with multiple threads.

Or search github for existing solutions to portable async IO.

查看更多
登录 后发表回答