I agree with you Jim that the atomic package classes provide a better performance than synchronization. The reason *probably* being that i can find the following code in most of the *efficient* methods
the compareAndSet() method makes a native call to set the value to next if it was equal to current.
So, the locking will *probably* happen in the native code that *may* make it faster.
Anyways, going back to the question, i dont think it is worth comparing the performance between a volatile and AtomicBoolean as they are present for different and specific requirements. The javadoc for atomic package itself says that these should not be taken as a replacement for volatile.
But I wouldn't want people to avoid using any method defined as native because they heard it's "costly".
Agree, cost is only a concern when we can achieve the same functionality without this cost. If there is no alternative then this question should not come into picture at all.