Installation
Add the dependency to yourpom.xml:
SharedRegion
create
RuntimeException on failure.
open
buffer
Returns ajava.nio.ByteBuffer backed by the shared memory mapping. No copying occurs.
notify
wait
true on notification, false on timeout.
close
SharedRegion implements AutoCloseable for try-with-resources:
Complete example
JNA internals
TheZincLib interface maps the C ABI functions:
libzinc_core.{so,dylib,dll} through its platform-native library loading mechanism. Ensure the library is on java.library.path or use Native.load with an absolute path.
The Pointer.getByteBuffer(offset, length) method creates a direct ByteBuffer wrapping the native memory. The JVM garbage collector does not manage this buffer. It is valid only as long as the region handle is open.