RFR (XS) CR 8014233: java.lang.Thread should be @Contended
dl at cs.oswego.edu
Thu May 9 10:38:30 UTC 2013
On 05/09/13 05:39, David Holmes wrote:
> Hi Aleksey
> Well the code change is easy enough to review :)
> As to the effects ... no way to judge that: time and testing will tell.
For some initial sanity-check testing, I just built lambda with
the added @Contended annotation on Thread and ran a few
of our jsr166 performance tests involving classes that
somehow frequently touch Thread fields. It seems to be
a strictly positive change. Not a dramatic one on average, but
the main benefit is avoiding occasional really terrible performance
due to the GC colocating all Thread objects, or locating them
near busy ThreadLocals etc.
More information about the core-libs-dev