RFR: 8209850: Allow NamedThreads to use GlobalCounter critical sections

Robbin Ehn robbin.ehn at oracle.com
Thu Aug 23 07:17:13 UTC 2018


Great stuff, thanks Kim!

But I strongly suggest keeping the three volatiles in SingleWriterSynchronizer 
on separate cache-lines. Specially _enter and _exit. I don't expect many of 
these and so I don't care about footprint. Am I wrong?

Thanks, Robbin

On 2018-08-22 21:18, Kim Barrett wrote:
> Please review this change to GlobalCounter, permitting NamedThreads to
> enter a critical section.
> 
> To accomplish this, we add a new RCU-inspired synchronization utility,
> SingleWriterSynchronizer.  This has some similarities to
> GlobalCounter, but the latter should be preferred except where it
> can't be used (such as in the implementation of GlobalCounter!).  This
> utility is based on a private utility embedded in OopStorage.  That
> private utility is being replaced by the new public one.
> 
> Using this new synchronization utility, we provide lock-free iteration
> over the list of NamedThreads that is safe against creation and
> deletion of such threads.  That iteration is used by GlobalCounter to
> examine all NamedThreads, rather than only the VMThread.
> 
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8209850
> 
> Webrev:
> http://cr.openjdk.java.net/~kbarrett/8209850/open.00/
> 
> Testing:
> mach5 tier1-3, hs-tier4-5.
> New synchronization utility includes a gtest.
> 


More information about the hotspot-dev mailing list