View Single Post
  #1 (permalink)  
Old 03-07-2008, 10:03 AM
illidian illidian is offline
Member
 
Join Date: Mar 2008
Posts: 1
illidian is on a distinguished road
Question about CAS (compare and swap) method
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.
Reply With Quote
Sponsored Links