Calling JVMTI outside JVM threads
Hi folks,
I'm writing a profiler-type application in C with the JVMTI. In Agent_OnLoad, I create a new thread which accept()s connection and passes them to another new thread which handles data from the network. I want to be able to control my agent over the network, specifically using SetEventNotificationMode. However, I find that calling any of the jvmti methods from my network thread does not work. Can anyone explain why this might be and if there is a workaround other than creating a new JVMTI environment for each network thread?
This is based on the heapTracker example in demo/jvmti/heapTracker/src/heapTracker.c which keeps a global copy of the jvmtiEnv*, although it is only used in native methods which were called from java.
Many thanks
Bruce Duncan

