Is there any justification not to ALWAYS use AtomicInteger as data members?
问题 In a multi-threaded environment like Android, where a simple int variable may be manipulated by multiple threads, are there circumstances in which it is still justified to use an int as a data member? An int as a local variable, limited to the scope of the method that has exclusive access to it (and thus start & finish of modifying it is always in the same thread), makes perfect sense performance-wise. But as a data member, even if wrapped by an accessor, it can run into the well known