It's not a secret anymore!
The moose likes Beginning Java and the fly likes Thread ( dead thread) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Thread ( dead thread)" Watch "Thread ( dead thread)" New topic

Thread ( dead thread)

Muhammad Usman

Joined: Nov 18, 2001
Posts: 29
hello to all ;
Q. Once a thread is dead, we can,t start it, but access its data ( i.e methods and member variables). What does it mean ?

an student of Operation Badar ( a educational movement in Pakistan).
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Check out the code below:

Once the mt thread is dead it can not be restarted, calling start on it again does nothing. But you can still access it variables and methods like any other object. In fact, you can even call the run method directly and have it execute again. It just wouldn't run in its own thread it would inline like any other method. Hope that helps
[ March 25, 2002: Message edited by: Dave Vick ]

Jeffy Yang

Joined: Mar 07, 2002
Posts: 2
Thread object or objects implemented Runnable interface are the same as other objects. So, even if a thread is dead, if a you still have a reference to that object, the object will not be GC, you can visit it's methods or members as other objects.
I agree. Here's the link:
subject: Thread ( dead thread)
It's not a secret anymore!