问题
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