JNI and multithreading
843829Feb 16 2005 — edited May 30 2005Hi all,
I have a question about jni and multithreading. I have a c application that communicates through jni with a java program. Both c and java, have two threads. Each c thread communicate with one java thread.
(----2 C threads----) JNI (----2 Java Threads--)
--------------------------> | ---------------------------->
--------------------------> | ---------------------------->
How can I make everything works fine, if the two c threads have a parallel execution ? I'm currently using Attach and DetachCurrentThread, but the execution is not parallel since the other thread have to wait for env* to be detached. Also I'm not allowed to used more than one JVM. Does anybody experienced that ?
Thanks a lot for any help.