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

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/mechanical-sympathy/CADkjdv8vbF%2B3d9Am5diRmcJ-1Sbix%2BPqXB5AfhE%2B%3DapzKP2LAw%40mail.gmail.com.

Reply via email to