Android NDK中是否有异步文件I/O? [英] Is there asynchronous file i/o in Android NDK?

查看:160
本文介绍了Android NDK中是否有异步文件I/O?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在我的C ++ android-ndk代码中保存/加载很多存储在sdcard上的数据.但是,有人告诉我Android NDK中没有异步文件IO <aio.h>,对吗?

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?

如果是这样,你们中的任何人都可以给我一个Android NDK中异步读取/写入文件的示例(或准则)吗?谢谢!

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

推荐答案

您是正确的,最新的Android NDK中没有可用的AIO:

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.

或在github上搜索可移植异步IO的现有解决方案.

Or search github for existing solutions to portable async IO.

这篇关于Android NDK中是否有异步文件I/O?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆