Answer the question
In order to leave comments, you need to log in
How does compare and swap work?
Explain in a simple way how compare and swap works? Let's say there is a variable that both stream1 and stream2 want to increment. Suppose thread1 entered earlier, do I understand correctly that thread2 can take the expected value while reading the variable by thread1, but before thread1 writes the new value?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question