atom feed19 messages in edu.oswego.cs.concurrency-interest[concurrency-interest] The Atomic*Fie...
FromSent OnAttachments
David M. LloydJul 14, 2012 11:01 am 
Doug LeaJul 14, 2012 11:17 am 
Stanimir SimeonoffJul 14, 2012 1:01 pm 
√iktor ҠlangJul 14, 2012 1:16 pm 
Rémi ForaxJul 14, 2012 2:20 pm 
Stanimir SimeonoffJul 14, 2012 2:58 pm 
Rémi ForaxJul 14, 2012 3:44 pm 
Doug LeaJul 15, 2012 3:37 am 
David HolmesJul 15, 2012 4:14 am 
√iktor ҠlangJul 15, 2012 8:22 am 
David M. LloydJul 15, 2012 9:19 am 
Jed Wesley-SmithJul 15, 2012 7:31 pm 
David HolmesJul 15, 2012 7:35 pm 
David M. LloydJul 15, 2012 7:43 pm 
David HolmesJul 15, 2012 7:52 pm 
Jason T. GreeneJul 20, 2012 11:42 am 
David HolmesJul 20, 2012 6:34 pm 
David M. LloydJul 22, 2012 1:47 pm 
Doug LeaJul 23, 2012 3:44 am 
Subject:[concurrency-interest] The Atomic*FieldUpdater situation
From:David M. Lloyd (
Date:Jul 14, 2012 11:01:59 am

What is the purpose of the access-time access check in the atomic field updater classes?

If I construct an atomic field updater, to me, this should be exactly equivalent to having an accessible=true Field instance. If I want to manage the visibility of that instance, I will restrict access to the updater itself.

The problem, as I am sure you are all well aware, is that when the updater classes are used on an object instance which is subclassed, even if the field being updated, the field updater, and the method calling into the field updater all exist on the base class and are private, an expensive access check has to occur.

Even when the class is final, the access check is still expensive relative to the operation itself!

I mean I'm using field updaters in the first place because I can't afford to have a jillion Atomic* objects floating around; obviously performance is critical here. And to add to this problem, you can't even rely on using Unsafe, even though it's becoming more and more prevalent in JDKs, as some platforms may not have atomic 64-bit operations, and there's no way I can see to test for that other than relying on the AtomicLong implementation to be similar to OpenJDK's.

Is there any recourse to solve this issue?