[concurrency-interest] CompareAndSet - can there also be NO winner?

Nathan Reynolds nathan.reynolds at oracle.com
Tue Nov 22 11:28:36 EST 2011


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.

Nathan Reynolds 
<http://psr.us.oracle.com/wiki/index.php/User:Nathan_Reynolds> | 
Consulting Member of Technical Staff | 602.333.9091
Oracle PSR Engineering <http://psr.us.oracle.com/> | Server Technology

On 11/22/2011 9:09 AM, Dr Heinz M. Kabutz wrote:
> Something I've wondered about for a while...
>
> 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 /always/ a winner?
> Regards
>
> Heinz
> -- 
> Dr Heinz M. Kabutz (PhD CompSci)
> Author of "The Java(tm) Specialists' Newsletter"
> Sun Java Champion
> IEEE Certified Software Development Professional
> http://www.javaspecialists.eu
> Tel: +30 69 72 850 460
> Skype: kabutz
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20111122/0f103eb7/attachment.html>


More information about the Concurrency-interest mailing list