This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Threads

 
Tony reedy
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
This is discussed previously,but I am confused with the choice c.
what's answer for the following question?
ThreadGroup class instances:
a) Allow threads to be manipulated as a group
b) Provide support for ThreadDeath listeners
c) May contain other ThreadGroups
d) Must contain threads of the same type

the explanations says
c) May contain other ThreadGroups
Nope.

Thread group is the highest level of aggregation of individual threads. Java doesn't support ( as far as I know ) groups of groups.
But I extracted from de API documentation:
A thread group represents a set of threads. In addition, a thread group can also include other thread groups.

I feel both statements are contradicting.
Is the answer yes or no
 
Rajinder Yadav
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure you can have a ThreadGroup contain another ThreadGroup, it makes perfect sense to control a 'smaller' group from a larger one
The JDK explanation is correct.
[ March 06, 2002: Message edited by: Rajinder Yadav ]
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!