Could someone explain to me the working and differences of above operations in multi-threading?
Could someone explain to me the working and differences of above operations in multi-threading?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
test-and-setmodifies the contents of a memory location and returns its old value as a single atomic operation.compare-and-swapatomically compares the contents of a memory location to a given value and, only if they are the same, modifies the contents of that memory location to a given new value.The difference marked in bold.