Hi,
First of all i would like to give thanks to ajith who helped me over some questions related to ThreadGroup. even though ThreadGroup is not in objectives of
SCJP.
Again i am looking for some help from our java experts on thread. basically i have some confusions and some questions here. All are related to thread. Q#1
This statement is from RHE and page#204 :
When the run() methods returns, the thread has finished its task and is considered dead........ The dead thread continues to exist; it is an object like any other, and you can still access its data and call methods. you just can't make it run agian. in other
word.
You can't restart a dead thread.
You can call the methods of a dead thread.
Here i understand that i can't use t.start() on a dead thread. but i don,t understand second point.
how can i call method on dead thread?
One more confusion
are dead threads not available for GC?
Q#2
List#1 : sleep and yield methods donot release the lock hold by thread.
List#2 : wait does release the lock hold by thread.
(what about suspand() and interrupt() methods?)
are there any other methods u would like to add in list#1 and List#2?
Q#3
A Thread can we considered dead when :
1. run() method returns
2. we invoke stop() method on thread ( i know it is deprecated)
are there any other way?
Q#4
A thread stop its execution due to
1. stop() method
2. sleep() method
3. yield() method
4. suspend() method
5. any method like waitForInput(), waitForImages() and waitForID()
6. due to IO
any thing else u would to like add.
Please try to understand me. i am trying to learn and i want your help. as we all knows that Thread is really one of the importent concept for the exam point of view.
Please correct me if a am wrong anywhere above.
Waiting for your reply.
thanks in advance.
vivek
[This message has been edited by Vivek Shrivastava (edited July 21, 2000).]
[This message has been edited by Vivek Shrivastava (edited July 21, 2000).]
[This message has been edited by Vivek Shrivastava (edited July 21, 2000).]