My application requires concurrent access to a data file using memory mapping. My goal is to make it scalable in a shared memory system. After studied the source code of memory mapped file library implementation, I cannot figure out:
- Is it legal to read from a
MappedByteBuffer
in multiple threads? Doesget
block otherget
at OS (*nix) level? - If a thread
put
into aMappedByteBuffer
, is the content immediately visible to another thread callingget
?
Thank you.
To clarify a point: The threads are using a single instance of MappedByteBuffer
, not multiple instances.