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


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

Re: AtomicReferenceArray writes and visibility

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: AtomicReferenceArray writes and visibility
Date Thu, 31 Mar 2011 21:22:56 -0700
Organization A noiseless patient Spider
Lines 23
Message-ID <in3jv4$1so$1@dont-email.me> (permalink)
References <in14ae$qap$1@Gaia.teknon.de>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Fri, 1 Apr 2011 04:23:00 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="sJe4u9VRc4chc5yBzxahWw"; logging-data="1944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185BsuzYNcG1RqKTV+Wb/elRFkh8wCe3xk="
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
In-Reply-To <in14ae$qap$1@Gaia.teknon.de>
Cancel-Lock sha1:XkQqcbF2j1MIxXLiRj5JKZ6v1Oc=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2688

Show key headers only | View raw


On 3/30/2011 10:43 PM, Volker Borchert wrote:
> Hello all,
>
> reading on the "new" memory model and AtomicReferenceArray, it
> seems that anything done before a .set() on an AtomicReferenceArray
> "happens-before" anything done after a .get() on the same
> AtomicReferenceArray.
>
> Two questions:
>
> 1. Am I right?


No. I know how the assembly language compare-and-swap instructions work, 
and there's little chance that they would be implemented with a memory 
barrier.  It could happen, on certain systems, but in general there's no 
synchronization, and no happens-before.


Read the source code for the AtomicReferenceArray.  set() doesn't use 
any synchronization.  It calls sun.misc.Unsafe#putObjectVolatile().  I 
don't see how that's going to create a happens-before.

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


Thread

AtomicReferenceArray writes and visibility v_borchert@despammed.com (Volker Borchert) - 2011-03-31 05:43 +0000
  Re: AtomicReferenceArray writes and visibility Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-03-31 00:52 -0700
    Re: AtomicReferenceArray writes and visibility v_borchert@despammed.com (Volker Borchert) - 2011-04-02 06:28 +0000
  Re: AtomicReferenceArray writes and visibility Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2011-03-31 20:55 -0700
  Re: AtomicReferenceArray writes and visibility markspace <-@.> - 2011-03-31 21:22 -0700
    Re: AtomicReferenceArray writes and visibility Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-03-31 21:54 -0700
      Re: AtomicReferenceArray writes and visibility markspace <-@.> - 2011-03-31 21:58 -0700
        Re: AtomicReferenceArray writes and visibility Patricia Shanahan <pats@acm.org> - 2011-03-31 22:24 -0700
          Re: AtomicReferenceArray writes and visibility markspace <-@.> - 2011-03-31 22:55 -0700
  Re: AtomicReferenceArray writes and visibility Lew <lew@lewscanon.com> - 2011-04-01 11:40 -0700

csiph-web