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


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

Re: Atomic integer array class question

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Tue, 10 Jan 2012 09:43:18 -0600
Date Tue, 10 Jan 2012 07:43:17 -0800
From Patricia Shanahan <pats@acm.org>
User-Agent Mozilla/5.0 (Windows NT 5.2; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: Atomic integer array class question
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>
In-Reply-To <be6dd390-0441-4336-a3f8-fe70964b9210@n39g2000yqh.googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Message-ID <PoWdnfMmUu0LwZHSnZ2dnUVZ_o-dnZ2d@earthlink.com> (permalink)
Lines 36
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 75.11.53.36
X-Trace sv3-zH9HTG5Yhg23zrR6leebU8/q5mv4sHlnkCFr9/prYZJZArlecmx9Px8PJPkIxmzSCbdlK9OjKhfYWFI!sTZtlnIDARI+ac/Sk9Lr8ERQGG989d8rvVzzw44qy9+8tnG5QRfw8cDwX2iDT/V7OsMjVYP9ck4Q!Ont9gGhk68K4I9ORq3QWLW2IqlXkilzFlBQXfkXGhLY=
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2664
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11177

Show key headers only | View raw


On 1/10/2012 6:22 AM, raphfrk@gmail.com wrote:
> On Jan 9, 6:56 pm, Patricia Shanahan<p...@acm.org>  wrote:
>> Spin waiting, especially spin waiting that has no delay and includes
>> access to a volatile variable, can be very expensive in terms of load on
>> the processor-memory interconnect.
>
> So, add a Thread.sleep(1); or something ?

I'm not at all sure you basic approach makes sense.

>
>> I'm still unclear what is intent, and what is infrastructure to do with
>> how you are trying to implement the intent. Could you provide a
>> description of what you want to have happen?
>
> It's basically a store that has 3 parts per element
>
> id (short)
> data (short)
> auxData (Object)
>
> However, for most places (say 95%+), it is (0, 0, null), so it really
> only needs only a short.
>
> 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).
...

My premature optimization detector is clicking rapidly. You are still
talking about a particular implementation, not what you want the
implementation to achieve.

Patricia

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next 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