Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JNI and multithreading

843829Feb 16 2005 — edited May 30 2005
Hi 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 27 2005
Added on Feb 16 2005
4 comments
1,233 views