You can't CAS on less than a word. AtomicBoolean is implemented using an int
and float
could be implemented using an int
and double
using a long
.
AFAIK, these were added as part of Doug Lea's concurrency library being included and there hadn't been enough of a need to have Atmoic versions of these types before.
IMHO an AtomicDouble could be useful, but I avoid using float
whenever possible due to the lack of precision.