Real life use and explanation of the AtomicLongFieldUpdate class
问题 Is anybody aware of any real life use of the class AtomicLongFieldUpdate? I have read the description but I have not quite grasped the meaning of it. Why do I want to know that? Curiosity and for OCPJP preparation. Thanks in advance. 回答1: You can think of a cost ladder for the following: ordinary long : cheap, but unsafe for multi-threaded access volatile long : more expensive, safe for multi-threaded access, atomic operations not possible AtomicLong : most expensive, safe for multi-threaded