java.nio.*Buffer read/write atomicity

Aleksey Shipilev aleksey.shipilev at
Thu Dec 20 17:54:41 UTC 2012

On 12/20/2012 09:49 PM, Vitaly Davidovich wrote:
> Just curious - what's the driver for this? Suppose it did have full
> width writes/reads - you still shouldn't use it in a data racey way
> since it's not spec'd to be threadsafe and you can only observe torn
> reads/writes if you access it without synchronization.

The driver is the infamous "principle of least astonishment", aided by
my purism. Java is remarkable in the way it deals with races, trying to
surprise the least when something breaks. I think the change that brings
in more consistency without sacrificing maintainability and/or
performance is the change we endorse, right?


More information about the core-libs-dev mailing list