2010/9/15 Nand <nandit...@gmail.com>:
> --
> 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.
>
>
Tim
In this pdf document, there native-thread-to-Java callback example (Page 7).
A callback_handler() function is called from a native thread. Every time this
callback handler is called, it both attaches and detaches the thread to the JVM.
Isn't this heavy? Isn't it better to attach the native thread once, perform any
number of callbacks, and detach the thread when the job's done?
--
Olivier
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/d/optout.
>>this no longer seems possible and I didn't find a currently working workaround either, just a blog post from the android guys telling not to do this(cache the object ref to the class) due to new memory protection things being added.
You're saying that you've created a global reference to a jclass returned by FindClass, and when you try to call NewObject for that class later on, it fails..? On which Android version / runtime / device?Do you have a link to that blog post you mentioned?
JNIEnv*
on the wrong thread. Now there’s a per-thread local reference table, it’s vital that you only use a JNIEnv*
on the right thread."