Can multiple threads see writes on a direct mapped ByteBuffer in Java?
I'm working on something that uses ByteBuffers built from memory-mapped files (via FileChannel.map() ) as well as in-memory direct ByteBuffers. I am trying to understand the concurrency and memory model constraints. I have read all of the relevant Javadoc (and source) for things like FileChannel, ByteBuffer, MappedByteBuffer, etc. It seems clear that a particular ByteBuffer (and relevant subclasses) has a bunch of fields and the state is not protected from a memory model point of view. So, you must synchronize when modifying state of a particular ByteBuffer if that buffer is used across