|
Title: Multi threading with Android? Post by: PompiPompi on May 18, 2012, 04:32:26 AM I wish to do multi threading in my game for Android. The issue is that I need to do it with JNI, I tried to do something like this but for some kind of a reason it seemed the multi thread version was really slow.
As if the second thread didn't really run and the app was stalled on mutexes. The same version work on PC. So how do you Android + Multi thread + JNI? Title: Re: Multi threading with Android? Post by: 71104 on May 18, 2012, 07:48:23 AM I don't happen to know anything about Android (except it is Linux programmed in Java) but "the same version works on PC" doesn't help very much since Android phones are natively different than PCs.
Anyway, what happens exactly? Is your app definitely stuck or does it eventually run but very slowly? Title: Re: Multi threading with Android? Post by: PompiPompi on May 18, 2012, 09:11:10 AM Oh, I worked it out. The code that got stuck was a while ago, after updating it a bit it works both on the PC and Android.
The important thing to remember is that if you use Posix threads in Android, it's just like any other OS with threads in C++. There is no magic that makes your thread not work, it works the same(as far as I can tell). There might be some small nusiance I am not aware of. Title: Re: Multi threading with Android? Post by: 71104 on May 18, 2012, 10:06:21 AM The important thing to remember is that if you use Posix threads in Android, it's just like any other OS with threads in C++. you're right, I said that Android phones are natively different from PCs because when I'm told "PC" I always think about Microsoft Windows, sorry. |