Results 1 to 6 of 6
Thread: Couple Questions on Thread
- 01-04-2010, 03:09 AM #1
Several Questions on Thread
I'm not getting join() method.
t.join() waits for the thread t to die.
So it's waiting for itself to die? Why?
What does it mean for a thread to "die?"
What happens after it dies?
What happens if it doesn't die?
sleep() method pauses the current thread for a specific time. Isn't that what join() is doing? What's the difference between them?
is join(0) the same as join() ?
It be appreciated if anyone could answer those questions.Last edited by Lil_Aziz1; 01-04-2010 at 03:33 AM.
- 01-04-2010, 06:36 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Do read the tutorials from the start. When discussing the join method we are dealing with two threads. Join causes the curently executing thread (the one that executed the t.join statement) to pause until the thread t has completed.
The sleep method on the other hand acts on one thread(the currently executing one). That's why it's static while join is not.
Reading the API specs and the tutorials is a must for understanding those things.
- 01-04-2010, 10:07 PM #3
API specs?
-
- 01-04-2010, 11:18 PM #5
Oh right. Just didn't know what it was called.
- 01-06-2010, 02:02 PM #6
Member
- Join Date
- Jan 2010
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
Couple of questions regarding threading
By exernet in forum New To JavaReplies: 1Last Post: 12-15-2009, 12:23 PM -
Thread questions
By McChill in forum New To JavaReplies: 2Last Post: 03-17-2009, 06:48 AM -
Couple of newbie questions
By ananasman in forum New To JavaReplies: 11Last Post: 11-20-2008, 11:54 PM -
a couple of questions about Software Engineering plz
By pheonix in forum New To JavaReplies: 9Last Post: 10-18-2008, 04:31 PM -
Couple of Problems
By joz_12345 in forum Java 2DReplies: 2Last Post: 03-06-2008, 04:13 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks