aspose file tools
The moose likes Threads and Synchronization and the fly likes Using of wait(long milliseconds) method , to make a Thread wait Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Using of wait(long milliseconds) method , to make a Thread wait" Watch "Using of wait(long milliseconds) method , to make a Thread wait" New topic
Author

Using of wait(long milliseconds) method , to make a Thread wait

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

If we use the wait(long milliseconds) option to make a Thread wait .

What happens to the Thread if the milliseconds specified has been completed ??



Does this Thread die after this seconds have been reached ??

Thanks .


Save India From Corruption - Anna Hazare.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8142
    
  52

Have you read http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#wait%28long%29


[My Blog] [JavaRanch Journal]
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

It says that :

Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.

My question is that what happens to the Thread when it has completed the timeout specified in wait method
Do you really know ??
Sandeep Sanaboyina
Ranch Hand

Joined: Dec 14, 2009
Posts: 72
Dude, why don't you try writing some code and executing it.


They say you have to be the first, the best or different. I say, is it too much to ask for all three.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8142
    
  52

Ravi Kiran V wrote:It says that :

Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.


And a lot more than that. Did you even read that entire documentation?

Ravi Kiran V wrote:
My question is that what happens to the Thread when it has completed the timeout specified in wait method


Read that documentation again, it has the answer.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Using of wait(long milliseconds) method , to make a Thread wait
 
Similar Threads
Question related to threads
Please Help Me...For Above Question
doubts regarding join from dans mock
multiple joins with timeouts
Join method