RFR: 8209850: Allow NamedThreads to use GlobalCounter critical sections

Kim Barrett kim.barrett at oracle.com
Wed Aug 22 19:18:36 UTC 2018


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