最后,我认识到激活锁省略似乎和被锁对象的数据大小有关系。
Finally I came to recognize that there seems to be some relation between the enabling of lock elision and the data size of the locked object.
我也希望逸出分析与锁省略一起更能够做到更好,产生更多的影响。
I was hoping that escape analysis combined with lock elision would have a much greater influence than it did.
这个优化叫做锁省略,是为Mustang安排的另一个JVM优化。
This optimization is called lock elision and is another of the JVM optimizations slated for Mustang.
在这个单线程化的基准测试中,Hotspot可以非常安全地将锁省略掉。
In the case of this single threaded benchmark, it is quite safe for Hotspot to safely elide the lock.
除了Escape分析和锁省略,Mustang还有一些锁定性能方面的优化。
In addition to escape analysis and lock elision, Mustang has some other optimizations for locking performance as well.
虽然所有锁的获得都是非竞争的,所以很快,但是编译器实际上可以用锁省略把同步完全清除掉。
While all of the lock acquisitions will be uncontended and therefore fast, the compiler can actually eliminate the synchronization entirely using lock elision.
从表面上看,锁省略似乎可以允许我们不必忍受同步带来的负担,就可以编写线程安全的代码了,前提是在同步的确是多余的情况下。
On the surface it looks as though lock elision allows us to write thread safe code without any synchronization penalty for using in cases where it really wasn't needed.
从表面上看,锁省略似乎可以允许我们不必忍受同步带来的负担,就可以编写线程安全的代码了,前提是在同步的确是多余的情况下。
On the surface it looks as though lock elision allows us to write thread safe code without any synchronization penalty for using in cases where it really wasn't needed.
应用推荐