On 8/6/13 12:16 PM, Martin Traverso wrote:
Is it safe to call Java code via JNI from the COMPILED_METHOD_LOAD
callback? The JVMTI spec is not explicit about this, and the closest
thing I could find is in relation to the GenerateEvents function:
"Attempts to execute Java programming language code or JNI functions
may be paused until this function returns - so neither should be
called from the thread sending the event. This function returns only
after the missed events have been sent, processed and have returned".
Thanks,
Martin
In general, event handlers should do as little as possible to avoid
adverse interactions with the rest of the VM. Calling Java code from
an event handler would not really qualify "as little as possible".
You should probably check out the "Handling Events" subsection in
this doc:
http://docs.oracle.com/javase/7/docs/platform/jvmti/jvmti.html#EventSection
In particular there is a bullet list of general guidelines.
Dan