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
MappedByteBufferin multiple threads? Doesgetblock othergetat OS (*nix) level? - If a thread
putinto 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.