JDK-8155232 : Augment Workgang to run task with a given number of threads
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-04-27
  • Updated: 2016-05-26
  • Resolved: 2016-05-02
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.
JDK 9
9 b120Fixed
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Duplicate :  
Relates :  
Description
In many cases more direct control about the number of threads for a given task is required. The current way of doing so is quite involved, requiring a few lines of code where every part is important.

Like:

size_t new_active_threads = ...
size_t old_active_threads = gang->num_active_threads();
gang->set_active_threads(new_active_threads);
gang->run_task(...);
gang->set_active_threads(old_active_threads);

The proposal is to add a method that allows you to set the number of threads to use for the given task directly.