Listing 5 shows the PRNG implementation using synchronization, and the alternate implementation using CAS.
清单5显示了使用同步的PRNG实现和使用CAS备选实现。
This month, I'll add another implementation to that benchmark, one that uses AtomicLong to update the PRNG state.
本月,我将向该基准添加其他实现,使用 AtomicLong 更新 PRNG 状态的实现。
Tim Peierls has constructed a simple benchmark for measuring the relative scalability of synchronized versus Lock, using a simple linear congruence pseudorandom number generator (PRNG).
Tim Peierls用一个简单的线性全等伪随机数生成器(PRNG)构建了一个简单的评测,用它来测量synchronized和Lock之间相对的可伸缩性。
应用推荐