Unclear language speicification make it very hard to define and implement the class java.lang.ThreadGroup()
1. activeCount(), the API indicates it should return the count of active threads
in this thread group. But there is no definition active. Actually, the thread
can be started or stopped, or just exits any time. There is no semantic mean
for that.
2. There are 8 methods in the ThreadGroup API have never been implemented. They
are threadsCount(), allThreadsCount(), groupsCount(), allGroupsCount(),
threads(), allThreads(), groups(), allGroups()
Is there any real need for these methods? What is semantics for the methods?
Is it safe to do so? Since we need to take snapshot of thread group, which
is likely to prevent a high priority thread to start or stop.
3. Since most os does not provide equivalent concept, it is very hard to map
the definition to os primitives.
We should make the api more clear before we provide the implementation. This bug
is response for bug 4083644.
1. activeCount(), the API indicates it should return the count of active threads
in this thread group. But there is no definition active. Actually, the thread
can be started or stopped, or just exits any time. There is no semantic mean
for that.
2. There are 8 methods in the ThreadGroup API have never been implemented. They
are threadsCount(), allThreadsCount(), groupsCount(), allGroupsCount(),
threads(), allThreads(), groups(), allGroups()
Is there any real need for these methods? What is semantics for the methods?
Is it safe to do so? Since we need to take snapshot of thread group, which
is likely to prevent a high priority thread to start or stop.
3. Since most os does not provide equivalent concept, it is very hard to map
the definition to os primitives.
We should make the api more clear before we provide the implementation. This bug
is response for bug 4083644.
- relates to
-
JDK-4083644 Thread and ThreadGroup don't implement/deprecate according to JLS 20.20
- Closed
-
JDK-4189292 (thread spec) ThreadGroup and Thread need better and tighter specs
- Closed
-
JDK-4494726 (thread) ThreadGroup.enumerate() does not return all active threads
- Closed