[concurrency-interest] CompareAndSet - can there also be NO winner?
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.
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?
> Dr Heinz M. Kabutz (PhD CompSci)
> Author of "The Java(tm) Specialists' Newsletter"
> Sun Java Champion
> IEEE Certified Software Development Professional
> Tel: +30 69 72 850 460
> Skype: kabutz
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest