RFR: 8212827: GlobalCounter should support nested critical sections
Robbin Ehn
robbin.ehn at oracle.com
Fri Oct 26 08:06:18 UTC 2018
Hi Kim,
On 23/10/2018 19:07, Kim Barrett wrote:
> Please review this change to GlobalCounter to support nested critical
> sections.
Great!
>
> While in the area, cleaned up a few things:
> - Improved comments for GlobalCounter API.
> - Cleaned up write_synchronize global counter increment.
> - Removed a useless acquire barrier in critical_section_begin.
Thanks for doing that!
>
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8212827
>
> Webrev:
> http://cr.openjdk.java.net/~kbarrett/8212827/open.00/
Looks good, ship it, below is just some notes.
I would like the return value here:
inline uintx GlobalCounter::critical_section_begin(Thread *thread) {
And thus the parameter here:
46 inline void GlobalCounter::critical_section_end(Thread *thread, uintx
begin_value) {
be an opaque type so we don't leak out the implementation, but as long as the
GlobalCounter have the implementation as name, that doesn't help much.
I'm thinking of something like:
inline RCUContext RCU::critical_section_begin(Thread *thread) {
inline void RCU::critical_section_end(Thread *thread, RCUContext context) {
Or
inline CSContext CriticalSection::begin(Thread *thread) {
inline void CriticalSection::end(Thread *thread, CSContext context) {
Thanks, Robbin
>
> Testing:
> mach5 tier1-5
> New gtest directly testing nested critical sections.
>
>
More information about the hotspot-dev
mailing list