Restrictions for lock coarsening?
linuxhippy at gmail.com
Tue Jan 6 09:47:13 PST 2009
> The basic strategy is to look for straightline control where an unlock meets a
> lock of the same monitor. If your loop body contains only one copy of your
> locked section then there's nothing coarsening can do.
Ah, thanks for the explanation.
I guess coarsening won't work anyway for my type of code, there is
probably too much code between unlock/lock and too complicated call
> Hmm. I would expect biased locking to handle your case perfectly with no
> CAS if things are as you describe. For startup purposes biased locking
> disabled at the beginning of the VM and is enabled after about 4 seconds.
Yes, with BiasedLocking the overhead is almost reduced to noise ...
and I guess it would be the perfect fit :)
Unfourtunatly the stuff integrates as part of the JRE and is almost
always created at startup.
I guess however disabling the biased-locking startup delay by default
would have some other negative impacts :-/
Thanks again, Clemens
More information about the hotspot-runtime-dev