IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • No replies
SystemAdmin
SystemAdmin
757 Posts

Pinned topic Question about CAS (compare and swap) method

‏2008-03-07T06:24:32Z |
CAS method can fail because of 2 reasons:
1. - the operation was failed because of other thread.
2. - the comparison was failed.
The question is: how I know the reason of failure? Because in first case I probably whould like to retry operation in loop until it succeeded, but in second case loop will be infinite.

Thanks.