Handling native threads during onPause()

独自空忆成欢 提交于 2019-12-13 14:26:04

问题


So I have an android game that has some tight integration of Java and C++. Both Java and C++ side use a lot of threads (polling, loading, calculating). Most of the threads are meant to run continuously in parallel with the rest of the app (for example to stream music from MP3). Some threads are meant to be run once (like submitting a large file to a cloud service).

Now the question is what's the best way to handle native threads during onPause/onResume events? Is it okay to just leave as they are, and possibly call sleep(x) on them? Or should they be killed (and their states stored somehow) and re-created during onResume?

来源:https://stackoverflow.com/questions/23007101/handling-native-threads-during-onpause

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