Hello
I have two questions.
1)
As we can see in the source code of AtomicLong, there should be a difference between calling set and lazySet, given that set calls Unsafe.putLongVolatile and lazySet calls Unsafe.putLongRelease, but looking at Unsafe source code, we can see that Unsafe.putLongRelease simply calls Unsafe.putLongVolatile.
So, may I conclude that calling set and lazySet on AtomicLong have the same affects?
2)
In AtomicInteger class, set just sets a value in a volatile variable, and lazySet calls Unsafe.putIntRelease, this one calls putIntVolatile.
Question: putIntVolatile has the same effects of setting a volatile variable (I think so), If yes, can we say that set and lazySet on AtomicInteger have the same effects?
Thanks