The line annotated in red is where biased locking is enabled.
红色的行是偏向锁被激活的地方。
If the lock happens to be accessed by only one thread, biased locking can be applied.
如果锁刚好只被一个线程访问,则可以使用偏向锁。
Whether or not biased locking is being performed (-xx: + UseBiasedLocking); note that JDK 1.6 + automatically does this.
是否执行偏向锁(biased locking,- XX: +UseBiasedLocking);注意,JD k 1.6及更高版本会自动执行这个特性。
Biased locking is derived from the observation that most locks are never accessed by more than one thread during their life time.
大多数锁,在它们的生命周期中,从来不会被多于一个线程所访问。
In fact, with the exception of column c, every run with biased locking turned on ended up providing approximately the same boost in performance.
事实上,除了C列以外,每次运行时如果开启偏向锁最终都会提供大致相同的性能提升。
The initial benchmarking results demonstrated that biased locking provided the best performance gain compared to any of the other available optimizations.
从最初的基准测试结果来看,偏向锁提供了最佳的性能,比其他的优化方式更有效。
The initial benchmarking results demonstrated that biased locking provided the best performance gain compared to any of the other available optimizations.
从最初的基准测试结果来看,偏向锁提供了最佳的性能,比其他的优化方式更有效。
应用推荐