AtomicInteger lazySet vs. set

Viewed 33011

What is the difference between the lazySet and set methods of AtomicInteger? The documentation doesn't have much to say about lazySet:

Eventually sets to the given value.

It seems that the stored value will not be immediately set to the desired value but will instead be scheduled to be set some time in the future. But, what is the practical use of this method? Any example?

6 Answers
Related