• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Help

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to all,
I need your help guys. I have no idea about ThreadGroup. can some one please explain it to me or provide some links so that i can learn something.
I am never sure about thread topic and questions. do u guys know any real tutorial about thread?
please also answer following two question. these are from IBM Mock exam.

Q#1
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

Q#2
The following are true with respect to the Thread class:
a) It cannot be subclassed

b) Each instance belongs in a ThreadGroup

c) Individual instances may communicate with each other

d) Unsecure / Unsigned Applets may not create new instances
Looking forward to hear from u guys. I would really appreciate your time and effort.
regards
vivek

[This message has been edited by Vivek Shrivastava (edited July 08, 2000).]
[This message has been edited by Vivek Shrivastava (edited July 08, 2000).]
 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Someone Please Help me!

vivek
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest Sun's tutorial on Threads.
 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can someone suggest the answer for the two questions askes by me.
i would appreciate it.
vivek
 
Ranch Hand
Posts: 289
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hie Vivek,
Here is my attempt
Q#1
ThreadGroup class instances:
a) Allow threads to be manipulated as a group
This is surely true.With thread groups you have the advantage of organizing your threads into a single unit, so you can manage them better.
b) Provide support for ThreadDeath listeners
I can not commit myself on this one yet I will come back to you when I am sure about this.
c) May contain other ThreadGroups
Obviously very true.
d) Must contain threads of the same type
FALSE, you can place any thread you desire in any thread group.
Q#2
The following are true with respect to the Thread class:
a) It cannot be subclassed
FALSE.One of the ways for creating Java threads is by subclassing the Thread class.
b) Each instance belongs in a ThreadGroup
This is quite tricky.I know you can create a Thread instance without specifying a thread group, but I am tempted to think that when you do not specify, your thread belongs to some default group, may be as according by the application main thread.I can not commit myself on this one yet, I will come back to you when I verify.
c) Individual instances may communicate with each other
definitely true.A thread instance is just like any other object and shares the same process and memory stack with other threads of the same app.
d) Unsecure / Unsigned Applets may not create new instances
false ,you can create as many thread instances in your applets as you can in an application.

I hope this helps. You might want to wait for other people to review and confirm my answers before before you consider them gospel .I believe I am right.
Good Luck,
Herbert
 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Herbert,
I really appreciate your effort and time. I found answer for question#2 as given by Bhatra regarding option 'B' in question#2. if u wanna have a look u can check here http://www.javaranch.com/ubb/Forum24/HTML/002294.html.
I am still waiting for someone else or herbert with 100% sure answer for the question#1.
Thanks herbert again!
regards
vivek

[This message has been edited by Vivek Shrivastava (edited July 10, 2000).]
reply
    Bookmark Topic Watch Topic
  • New Topic