JDK-4097747 : No easy way to get all threads in a thread group
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.2.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1997-12-08
  • Updated: 1998-06-25
  • Resolved: 1998-06-25
Related Reports
Duplicate :  
Description

Name: ccC48265			Date: 12/08/97


The design of thread groups seems inadequate:

The only way to get all the threads in a thread group is with activeCount
and enumerate.  But if the number of threads changes between the two method
calls, there is no way to detect this; and if there is some way to combine
the two actions into a single atomic action, it is not documented.

Better to have a design similar to Collections, where enumerate is replaced
by a (single, atomic) method that returns an array of threads.

Also, it would be convenient to have a join method for thread groups, that
joins with every thread in the group.

(Review ID: 21520)
======================================================================

Comments
WORK AROUND Name: ccC48265 Date: 12/08/97 No airtight one I can see. Using activeCount and enumerate should work if thread group is not growing. ======================================================================
11-06-2004

EVALUATION This RFE was first reported in 2/96 (1243764). This RFE adds the suggestion of a join method for Thread groups. Both are fine suggestions; unfortunately, it's too late for 1.2. joshua.bloch@Eng 1998-06-25
25-06-1998