Java Atomic Types are simple mutable types that provide basic operations that are thread-safe and atomic without resorting to locking. They are intended for use in cases where locking would be a concurrency bottleneck, or where there is risk of deadlock or livelock.
Parameter | Description |
---|---|
set | Volatile set of the field |
get | Volatile read of the field |
lazySet | This is a store ordered operation of the field |
compareAndSet | If the value is the expeed value then sent it to the new value |
getAndSet | get the current value and update |
Many on essentially combinations of volatile reads or writes and CAS operations. Best way to understand this is to look at the source code directly. E.g. AtomicInteger, Unsafe.getAndSet