Is there asynchronous file i/o in Android NDK?

廉价感情. 提交于 2019-12-24 09:39:01

问题


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:


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.



来源:https://stackoverflow.com/questions/44611137/is-there-asynchronous-file-i-o-in-android-ndk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!