Re: Contended Locking Behavior

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Contended Locking Behavior

JSR166 Concurrency mailing list
Hello All,

  Sorry for spam, any thoughts on this?

Thanks
Ionut

On Monday, April 30, 2018, 4:57:43 PM GMT+3, Ionut Balosin <[hidden email]> wrote:


Hello All,

      I play with a stress test regarding contented locks in JDK 9.0.4 and I have observed below behavior which I would like to double check with you in order to correct my understanding:

- under a "relatively small - medium" contention (i.e. up to 64 threads accessing same lock) default locking scheme inside HotSpot JVM (-XX:+UseBiasedLocking -XX:-UseHeavyMonitors) seems to behave faster than using heavy monitors
- starting with higher number of threads (i.e. 64 threads in my test) enabling heavy monitors (-XX:-UseBiasedLocking -XX:+UseHeavyMonitors)  performs better

To sum up: my findings are that heavy monitors brings performance under really high contention however in cases where there are relatively small number of threads default locking scheme seems more beneficial (whatever high or small means ... probably it might be subject to hardware architecture)

My config: CPU: Intel Core i7 6700HQ / OS: Ubuntu x64 16.10

Can you confirm/infirm this?

Thanks
Ionut


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest