We can apply to the ScalableReentrantRWLock the same technique described in this post where we add an integer to the ReadersEntry class and increment/decrement that int instead of the AtomicInteger, this way the number of synchronizations is reduced.
Here is a plot of the performance comparison:
With this approach we see a constant performance improvement of the order of 10% to 15%.
The new implementation will be available on version 2.0 of the Concurrency Freaks library.
No comments:
Post a Comment