[concurrency-interest] Fwd: Should I avoid compareAndSet with value-based classes?

Andrew Haley aph at redhat.com
Fri Jul 7 09:52:24 EDT 2017

On 07/07/17 14:41, David Lloyd wrote:
> On Fri, Jul 7, 2017 at 4:20 AM, Andrew Haley <aph at redhat.com> wrote:
>> In practice it doesn't matter, because you don't need to CAS a
>> reference to an Instant: all you need to do is to wrap all of the
> I think you must have meant, "In practice it doesn't matter _in this
> particular case_".  The problem of general data structures which use
> CAS for updates matters very much in practice.

I'm talking about the problem of atomically updating an instance of a
value-based class while multiple threads are accessing it.  Unless I
am very much mistaken this thread is about no other subject.

Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the Concurrency-interest mailing list