JDK-7098506 : G1: Introduce safer STS join/leave (and vice versa) critical sections
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs23
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2011-10-06
  • Updated: 2016-05-24
  • Resolved: 2016-05-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Related Reports
Duplicate :  
Relates :  
In G1 there are many places where code is bracketed by calls to SuspendibleThreadSet::join() and SuspendibleThreadSet::leave() (and vice versa).

It'd be helpful to introduce two classes that automatically ensure that the appropriate action is taken at the start and end of such a critical section using the standard idiom of calling the appropriate method in the constructor and destructor of each class (similar to how MutexLocker / MutexUnlocker work).

Closing this since the last piece of this enhancement (adding the SuspendibleThreadSetLeaver) was done in JDK-8079579.

Part of this enhancement was implemented in JDK-8039147, where the SuspendibleThreadSetJoiner helper class was added. Keeping this RFE open for now as there's still no SuspendibleThreadSetLeaver helper class, which we might want to also add. There's currently only one case where that would be used, which is inside CMConcurrentMarkingTask::work().