title: Native multithreading and JNI
body: <p>I have an Android application which consists of some native threads (not attached to JVM) which need to be able to call methods of a Java object.</p>
  
  <p>The way in which I was intending to do this was to create a JNI function which I call from the relevant Java object which allows me to obtain and cache the required java object method ID's, JNIEnv and object references in a static native data structure so that my native threads can  (thread safely) access the required methods (e.g. using (*env)->CallVoidMethod(env, this, JavaMethodID, ...), etc;</p>
  
  <p>I'm not convinced this approach is going to work, since I read that the JNIEnv pointer can't be shared between threads, and that only threads which are attached to the JVM can do this kind of thing...  </p>
  
  <p>Is this a viable approach?  </p>