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

Dawid Kurzyniec dawidk@mathcs.emory.edu
Fri, 9 Jan 2004 14:25:34 -0500

On Friday 09 January 2004 01:45 pm, Larry Riedel wrote:
> I would expect developers to use their objects in a sane way,
> and I think the language/API should primarily try to facilitate
> that, not try to preclude them from doing things which might
> be a mistake in some contexts.

Well, the point here is that those things would be a mistake in _all_ the 
contexts for which AtomicX classes are designed, as they exist to support 
unsynchronized concurrent modifications.

The comparable etc. exist for classes which are either immutable (from the 
comparison point of view) or at least with the mutability under control of 
the application (via either confinement or synchronization), so that the 
comparison results may be relied upon for some definite period of time. 
AtomicX have the exactly opposite intent: to facilitate concurrent 
modifications assuming lack of confinement or synchronization.

Please refer to "Concurrent Programming in Java" (ISBN 0-201-31009-0) for 

Dawid Kurzyniec