Async IO on android >= 2.1

420 views
Skip to first unread message

Louise Cypher

unread,
Dec 15, 2010, 4:17:43 AM12/15/10
to andro...@googlegroups.com
Hi

Is there any support for ASYNC io in native conde on androids >= 2.1 ?
I'v searched in headers but aio_read and such are not present, and sys/limits.h undefines _POSIX_ASYNCHRONOUS_IO, so no ASYNC IO ?

I need to constantly stream chunks of data from big resource file located on SD card, and on iPhone we use async io for this purpose, I just dont want to create another thread in my app
to do io in nonblocking way from native.

--
Code it black!

Igor R

unread,
Dec 15, 2010, 4:30:56 AM12/15/10
to andro...@googlegroups.com

Take a look at Boost.Asio

Louise Cypher

unread,
Dec 15, 2010, 4:40:48 PM12/15/10
to andro...@googlegroups.com
.... android does not have asio_* so the stream part probably will be broken.

I need something that is in system, if there is no such thing i can do it myself by creating additional thread(s) to realise io requests and notify me about completion status, but i want to avoid this.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.




--
--
Code it black!

David Turner

unread,
Dec 15, 2010, 5:09:46 PM12/15/10
to andro...@googlegroups.com
There is no aio_ support in Bionic at this point. I recommend either using threads or non-blocking i/o as an alternative.

Regards

Igor R

unread,
Dec 15, 2010, 6:10:21 PM12/15/10
to andro...@googlegroups.com
> .... android does not have asio_* so the stream part probably will be
> broken.

I'm not sure what you mean, but Asio is a header only library, so you
don't need any *.so...

David Turner

unread,
Dec 16, 2010, 7:51:19 AM12/16/10
to andro...@googlegroups.com
Sorry, typo, I meant the aio_* functions like aio_open(), aio_read(), etc...
These functions are typically implemented by the C library using threads. Bionic doesn't provide them for now so you will have to do it yourself.


--
Reply all
Reply to author
Forward
0 new messages