2

We are using JVMTI and JNI to issue static method calls in method entry and method exit callbacks of the JVMTI. We have a need to be able to call a static method on a Thread Context other then the Thread Context that JVMTI has issued the callback on for the method entry and method exit callbacks.

Through experimentation we have found the JNIEnv which is passed in to the method callbacks is sufficient to be able to issue a callback on a specific thread context, but we also determined that the pointer / lifetime of the JNIEnv passed into the method callback is temporary and doesn’t persist beyond the call.

How is one if possible able to call a Static Method in a Java Class and specifically do that on a specified Thread Context.

Amy
  • 21
  • 1
  • There's not a lot of information in your question, so I can only make a general suggestion: You could realize your background threads in the form of "handlers". That is, objects that spawn a background thread which monitors a queue of `std:: function`s. You can post new `std:: function`s to the handler's queue from the outside, and the handler will then execute those sequentially on its background thread. – Michael Mar 22 '18 at 07:21

0 Answers0