• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

IBMmock - ThreadGroup

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
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
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me try.
a) Allow threads to be manipulated as a group
Yes.
The proof is in the pudding. Name of the class itself suggests it is a group of threads. If you are curious, take a look at API documentation about the methods it supports.
b) Provide support for ThreadDeath listeners
May be.
I am not sure what they mean by this. However, you can subclass ThreadGroup and override the uncaughtException method. This method gets called when a thread in the group is about to die due to an unhandled exception.
c) May contain other ThreadGroups
Yes!
A Thread group can contain threads or threadgroups.
d) Must contain threads of the same type
Nope.
Not necessarily. You can mix and match both user and daemon threads and assign them to a same group.

Hope this helps.
BTW - I am not sure if ThreadGroups are included in SCJP objectives.

Ajith

[This message has been edited by Ajith Kallambella (edited July 26, 2000).]
 
Ranch Hand
Posts: 477
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajith you said:



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.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marcela,
You are right and I was wrong. I just ate my hat and I have corrected my statement.
Thanks for noticing it!
Ajith
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ajith and Marcela.
I have some idea about the ThreadGroup. I am not sure if it will be in real exam. However, I believe, the more I am prepared, the higher score I will get.
Thanks again!
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear mikeliu,
I am trying to appear in the IBM mock exams for
more than a month. But when I try to login the site displays
an error ( Exception in object). I have contacted the webmaster
but in vain. Please let me know when u appeared for it and
the browser/version u are using . Provide the exact URL also.
Bye
Shailendra Bade
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shailendra,
I am using IE 5.0 to surf on the net. The IBM mock URL is http://certify.torolab.ibm.com/. I never have the problem like you have and I can log on anytime. Please try again. Feel free to contact me if you any problem.
Good luck.
Mike
 
reply
    Bookmark Topic Watch Topic
  • New Topic