[concurrency-interest] Min and Max for Atomics

Andrew Haley aph at redhat.com
Thu Aug 10 13:56:58 EDT 2017


On 10/08/17 18:35, Nathan and Ila Reynolds wrote:
> Yes, I get the same behavior, but I will have to pay for a cache 
> invalidation, CAS and a memory fence with each call.  For example, if I 
> am tracking a high-water mark then at the beginning the updates should 
> be very often and then taper off to nothing.  Thus, over time the cost 
> is reduced to a load from cache or RAM.

What is this cache invalidation of which you speak?  After the
AtomicReference.updateAndGet() discussion last time around, it was
clear enough that no such thing was necessary.  And besides that,
the message is clear: use a VarHandle for such things.

-- 
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