Calling into Java from COMPILED_METHOD_LOAD callback
Daniel D. Daugherty
daniel.daugherty at oracle.com
Tue Aug 6 12:16:21 PDT 2013
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20130806/e50c65aa/attachment.html
More information about the serviceability-dev
mailing list