If the C++ and Java is in the same process you don't even need a memory mapped file. Just use native memory.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
--
When you are in a JNI call (blocking or not doesn't matter) your thread is *at* a safepoint. The safepoint starts with the entry into JNI, and ends when it returns. If you make any JNI API calls to access Java state from within the native code, those individual calls each leave the safepoint, do their java state access, and then enter a safepoint again before returning.
The exception to this is what the JVM calls the JNI critical lock, which *may* be held between calls to GetPrimitiveArrayCritical and ReleasePrimitiveArrayCritical or between GetStringCritical and ReleaseStringCritical (the JVM actually has the option of making a copy and avoiding the lock, but in practice virtually all JVMs implement a GC blocking lock and grab the lock between these calls). Use of critical array and critical string access is HIGHLY discouraged, and is usually an indication of broken code (or code dating to before Java 1.4, when direct buffers were introduced in NIO), as the same logic can always be better achieved by using direct buffers.