[concurrency-interest] adaptive spinning/biased locking and java.util.concurrent.lock

Doug Lea dl at cs.oswego.edu
Tue Jun 30 16:51:58 EDT 2009


Peter Veentjer wrote:
> Hi Guys,
> 
> do modern jvm's also provide adaptive spinning and biased locking for
> the lock implementations (especially the reentrantlock) in the
> java.util.concurrent.locks package or is this only provided for the
> intrinsic lock?
> 

Only intrinsics. Biased locking does not work well
for locks that you expect to contend, which are among
the typical cases for using ReentrantLock. We might
someday want to automate adaptive spinning in
ReentrantLock and other AQS locks. However, this is
less pressing an issue than it is for in intrinsic locks,
since you can always use tryLock-based constructions
to increase spinning.

-Doug


More information about the Concurrency-interest mailing list