<br><br><div class="gmail_quote">On Tue, Nov 22, 2011 at 5:28 PM, Nathan Reynolds <span dir="ltr"><<a href="mailto:nathan.reynolds@oracle.com">nathan.reynolds@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    It depends upon the processor.  On x86, there will always be a clear
    winner because forward progress is guaranteed.  On other processors,
    it depends if it guarantees forward progress.<br></div></blockquote><div><br>It also heavily depends on the current value ;-)<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#FFFFFF" text="#000000">
    <br>
    <div><a href="http://psr.us.oracle.com/wiki/index.php/User:Nathan_Reynolds" target="_blank">Nathan
        Reynolds</a> | Consulting Member of Technical Staff |
      <a href="tel:602.333.9091" value="+16023339091" target="_blank">602.333.9091</a><br>
      <font color="red">Oracle</font> <a href="http://psr.us.oracle.com/" target="_blank">PSR Engineering</a> | Server
      Technology<br>
    </div><div><div></div><div class="h5">
    <br>
    On 11/22/2011 9:09 AM, Dr Heinz M. Kabutz wrote:
    </div></div><blockquote type="cite"><div><div></div><div class="h5">
      Something I've wondered about for a while...<br>
      <br>
      If we have an atomic integer (or any other atomic class) and two
      threads call compareAndSet(42, 43) at the same time, is it
      possible
      that both calls fail?  Or is there <i>always</i> a winner?<br>
      <pre cols="72">Regards

Heinz
-- 
Dr Heinz M. Kabutz (PhD CompSci)
Author of "The Java(tm) Specialists' Newsletter"
Sun Java Champion
IEEE Certified Software Development Professional
<a href="http://www.javaspecialists.eu" target="_blank">http://www.javaspecialists.eu</a>
Tel: <a href="tel:%2B30%2069%2072%20850%20460" value="+306972850460" target="_blank">+30 69 72 850 460</a>
Skype: kabutz 
</pre>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
Concurrency-interest mailing list
<a href="mailto:Concurrency-interest@cs.oswego.edu" target="_blank">Concurrency-interest@cs.oswego.edu</a>
<a href="http://cs.oswego.edu/mailman/listinfo/concurrency-interest" target="_blank">http://cs.oswego.edu/mailman/listinfo/concurrency-interest</a>
</pre>
    </blockquote>
  </div>

<br>_______________________________________________<br>
Concurrency-interest mailing list<br>
<a href="mailto:Concurrency-interest@cs.oswego.edu">Concurrency-interest@cs.oswego.edu</a><br>
<a href="http://cs.oswego.edu/mailman/listinfo/concurrency-interest" target="_blank">http://cs.oswego.edu/mailman/listinfo/concurrency-interest</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Times;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="font-family:arial;font-size:small"><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">Viktor Klang<br>
<br>Akka Tech Lead</span><div><font face="arial, sans-serif"><span style="border-collapse:collapse"><a href="http://www.typesafe.com/" target="_blank">Typesafe</a><span> </span>- Enterprise-Grade Scala from the Experts</span></font><br>
<font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font><font face="arial, sans-serif" size="2"><span style="border-collapse:collapse">Twitter: @viktorklang</span></font></div></span></span><br>