[concurrency-interest] volatile guarantee for directbuffer
oztalip at gmail.com
Tue Feb 14 15:25:58 EST 2012
> I'm not sure what you mean be OffHeap, but actually that doesn't matter
> at all: Writing to a volatile will make _all_ writes that happened
> earlier in the same thread visible to all threads, no matter what
> and where that earlier-written data is. (I use to tell my students
> "writing to a volatile flushes the cache".)
Main question wasn't about guarantees of volatiles at all. We can use
volatile variables to guarantee 'happens-before' for the data we have
on-heap. Does it give the same guarantees for the the data stored
off-heap. DirectByteBuffer would be a good example of off-heap data.
I at least got one answer saying 'yes' to my question.
More information about the Concurrency-interest