Achieving higher throughput with atomic variables.
使用原子变量获得更高的吞吐量。
While you may never use atomic variables directly in your classes, there are good reasons to cheer for their existence.
虽然您可能永远不会直接使用原子变量,还是应该为它们的存在而欢呼。
An introduction to nonblocking algorithms: Describes how concurrent algorithms can be implemented without locks, using atomic variables.
非阻塞算法简介:介绍如何使用原子变量而不是锁实现并发算法。
Because so little work is done in each unit of work, the graphs below probably understate the scalability benefits of atomic variables compared to ReentrantLock.
因为在每个工作单元中完成的工作很少,所以下图可能无法完全地说明与ReentrantLock相比,原子变量具有哪些可伸缩性优点。
Under the hood, operations on atomic variables get turned into the hardware primitives that the platform provides for concurrent access, such as compare-and-swap.
在表面之下,原子变量的操作会变为平台提供的用于并发访问的硬件原语,比如比较并交换。
Atomic variables have memory semantics similar to that of volatile variables, but because they can also be modified atomically, they can be used as the basis for lock-free concurrent algorithms.
原子变量的内存语义与volatile变量类似,但是因为它们也可以被原子性地修改,所以可以把它们用作不使用锁的并发算法的基础。
Atomic variables have memory semantics similar to that of volatile variables, but because they can also be modified atomically, they can be used as the basis for lock-free concurrent algorithms.
原子变量的内存语义与volatile变量类似,但是因为它们也可以被原子性地修改,所以可以把它们用作不使用锁的并发算法的基础。
应用推荐