[concurrency-interest] 8145539: (coll) AbstractMap.keySet and .values should not be volatile

Justin Sampson jsampson at guidewire.com
Tue Apr 26 15:12:18 EDT 2016


Vitaly Davidovich wrote:

> The problem is compilers can do weird things on the assumption of
> data race free code. If you haven't seen
> https://software.intel.com/en-us/blogs/2013/01/06/benign-data-races-what-could-possibly-go-wrong
> I recommend reading it. It's in the context of C/C++/Go but the
> general point stands.

Interesting -- that article actually seems to describe cases of
thin-air reads due to the compiler reusing memory locations, which
is impossible in Java even for racy code, right?

Thanks,
Justin



More information about the Concurrency-interest mailing list