[concurrency-interest] CompareAndSet - can there also be NO winner?
viktor.klang at gmail.com
Tue Nov 22 11:33:57 EST 2011
On Tue, Nov 22, 2011 at 5:28 PM, Nathan Reynolds <nathan.reynolds at oracle.com
> 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.
It also heavily depends on the current value ;-)
> Nathan Reynolds<http://psr.us.oracle.com/wiki/index.php/User:Nathan_Reynolds>| Consulting Member of Technical Staff |
> 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 Professionalhttp://www.javaspecialists.eu
> Tel: +30 69 72 850 460
> Skype: kabutz
> Concurrency-interest mailing listConcurrency-interest at cs.oswego.eduhttp://cs.oswego.edu/mailman/listinfo/concurrency-interest
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - Enterprise-Grade Scala from the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest