...且所这些引用都不能“逸出”到这个空间以外地方那么HotSpot会要求JIT进行一系列运行时优化其中一种优化就锁省略(lock elision)如果锁引用限制局部空间中说明只创建这个锁线程才会访问该锁这种条件下同步块中值永远不会存竞争这意味这我们永远不可能真需要这...
基于20个网页-相关网页
This optimization is called lock elision and is another of the JVM optimizations slated for Mustang.
这个优化叫做锁省略,是为Mustang安排的另一个JVM优化。
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.
最后,我认识到激活锁省略似乎和被锁对象的数据大小有关系。
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.
从表面上看,锁省略似乎可以允许我们不必忍受同步带来的负担,就可以编写线程安全的代码了,前提是在同步的确是多余的情况下。
应用推荐