[concurrency-interest] Re: AtomicInteger and AtomicLong should implement Number

David Holmes dholmes@dltech.com.au
Tue, 6 Jan 2004 09:11:48 +1000


Larry Riedel wrote:
> The reason I avoid even suggesting "extend"ing from a class is that
> Java has not traditionally provided support for multiple inheritance
> of implemention, which has lead to using naming conventions and/or
> runtime gyrations to produce an object which looks and behaves as
> though its class Q had inherited implemention from class X and class
> Y, but which, from the point of view of the language/compiler, is
> unrelated to class X or class Y.

I'm not going to debate the merits or otherwise of Java's object
model, but I want to clarify some intentions:

The AtomicX classes are "wrappers" for accessing primitive values or
references using atomic instructions. AtomicInteger is not a wrapper
for java.lang.Integer and the name was not meant to imply that. The
atomic classes allow for lock-free synchronization in some situations
(though actual lock-freedom is a quality of implementation issue).

That said I'm still digesting Gregg's detailed comments.

David Holmes