I have found AtomicInteger
, AtomicLong
, but where is AtomicFloat
(or AtomicDouble
)? Maybe there is some trick?
It's not a java issue, all languages suffer from this.
The assembly instructions which the atomic compare and swap operations compile down to are variants of: http://x86.renejeschke.de/html/file_module_x86_id_41.html
These all operate on integers and the pipelined nature of the FPU makes it much harder to implement for floats/doubles.