I have noticed that there is NO AtomicBooleanArray datatype in Java similar to the AtomicIntegerArray. Although I can use AtomicBoolean[] for my current needs, I was curious to get an understanding as to why AtomicBooleanArray is NOT part of the library.
Any thoughts in this would be much appreciated.
Thanks
AtomicBoolean actually wraps a int which is set to 0 or 1 for false or true. This is because it uses compareAndSwap methods which are int based, and not smaller.
You could implement an AtmoicBooleanArray, but not cleanly which is perhaps why it is not there. i.e. the JVM doesn't support atomic boolean operations because the CPUs like x64 and ARM don' support it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With