Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11179

Re: Atomic integer array class question

From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: Atomic integer array class question
Date 2012-01-10 08:37 -0800
Organization A noiseless patient Spider
Message-ID <jehpg6$asf$1@dont-email.me> (permalink)
References <9d7d89a6-3109-412f-a898-e2c9e82b780b@cs7g2000vbb.googlegroups.com> <jef22t$oc9$1@dont-email.me> <803273c0-b874-4d53-a9f7-70cbefac5ddd@k5g2000vba.googlegroups.com> <L4SdnYBDN4fhpZbSnZ2dnUVZ_gudnZ2d@earthlink.com> <be6dd390-0441-4336-a3f8-fe70964b9210@n39g2000yqh.googlegroups.com>

Show all headers | View raw


On 1/10/2012 6:22 AM, raphfrk@gmail.com wrote:

> I am planning to have a short array for the main store.  That will be
> based on AtomicInteger and storing two shorts per index (it uses
> compareAndSet to allow one short out of the int to be updated
> atomically).
>
> I also plan to reserve some of the short values as indexes into a
> second array.


I want to echo Patricia's comments and say that you still haven't 
explained what it is you are trying to do, what problem you are trying 
to solve.  This clearly describes an implementation, not the design goal 
at hand.

What do these ints ultimately represent?  Items for sale?  Customer 
purchases?  Factory assemblies?

Also, similar to Patricia, my bullshit meter is beeping loudly.  In 
fact, I see the extra large manure shovel has automatically deployed, 
and the rubber hip boots have dropped from the ceiling.  You're design 
is so obfuscated that even knowing your design goal it's likely to be an 
unmaintainable mess.  Expect to be chastised by any other programmer who 
sees this disaster.

You might want to back up and just do the obvious, like store a bunch of 
simple data objects in a synchronized collection.  I'd think that would 
be faster than what you have, as well as infinitely more maintainable.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Atomic integer array class question "raphfrk@gmail.com" <raphfrk@gmail.com> - 2012-01-09 07:10 -0800
  Re: Atomic integer array class question Knute Johnson <nospam@knutejohnson.com> - 2012-01-09 07:45 -0800
    Re: Atomic integer array class question "raphfrk@gmail.com" <raphfrk@gmail.com> - 2012-01-09 08:17 -0800
      Re: Atomic integer array class question Patricia Shanahan <pats@acm.org> - 2012-01-09 10:56 -0800
        Re: Atomic integer array class question "raphfrk@gmail.com" <raphfrk@gmail.com> - 2012-01-10 06:22 -0800
          Re: Atomic integer array class question Roedy Green <see_website@mindprod.com.invalid> - 2012-01-10 06:52 -0800
          Re: Atomic integer array class question Lew <noone@lewscanon.com> - 2012-01-10 07:17 -0800
          Re: Atomic integer array class question Patricia Shanahan <pats@acm.org> - 2012-01-10 07:43 -0800
          Re: Atomic integer array class question markspace <-@.> - 2012-01-10 08:37 -0800

csiph-web