Dan Posluns
2012-12-21 18:50:06 UTC
Hi there,
I'm using boost::io_service to manage cross-platform multithreading tasks for
iOS and Android NDK. Occasionally, I get hangs on either platform.
My latest problem is io_service::poll_one on Android, which hangs with the
following callstack:
(std::__atomic0::__atomic_base<long>::load(std::memory_order) const+44)
#02 pc 00454f1c /data/app-lib/com.decarta.myditu.nav-1/libnavlib.so
(std::__atomic0::__atomic_base<long>::operator long() const+20)
#03 pc 0044deac /data/app-lib/com.decarta.myditu.nav-1/libnavlib.so
(boost::asio::detail::task_io_service::poll_one(boost::system::error_code&)+60)
I had a similar problem with io_service::run_one on iOS, where the single worker
thread would occasionally hang in pthread_cond_wait() no matter how many times I
called post() on the service from a different thread. I switched to a poll_one()
implementation with my own condition lock to circumvent it on that platform, but
the bug remains.
I love the functionality of Boost.Asio but these hangs are killing me,
especially on Android. They are extremely infrequent but I have no clue what I
can do about them. (We are using gnustl for our standard library in NDK.)
Any advice?
Thanks,
Dan.
I'm using boost::io_service to manage cross-platform multithreading tasks for
iOS and Android NDK. Occasionally, I get hangs on either platform.
My latest problem is io_service::poll_one on Android, which hangs with the
following callstack:
(std::__atomic0::__atomic_base<long>::load(std::memory_order) const+44)
#02 pc 00454f1c /data/app-lib/com.decarta.myditu.nav-1/libnavlib.so
(std::__atomic0::__atomic_base<long>::operator long() const+20)
#03 pc 0044deac /data/app-lib/com.decarta.myditu.nav-1/libnavlib.so
(boost::asio::detail::task_io_service::poll_one(boost::system::error_code&)+60)
I had a similar problem with io_service::run_one on iOS, where the single worker
thread would occasionally hang in pthread_cond_wait() no matter how many times I
called post() on the service from a different thread. I switched to a poll_one()
implementation with my own condition lock to circumvent it on that platform, but
the bug remains.
I love the functionality of Boost.Asio but these hangs are killing me,
especially on Android. They are extremely infrequent but I have no clue what I
can do about them. (We are using gnustl for our standard library in NDK.)
Any advice?
Thanks,
Dan.