File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes About Thread topics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About Thread topics" Watch "About Thread topics" New topic
Author

About Thread topics

rajesh kumar rayavarapu
Greenhorn

Joined: May 16, 2007
Posts: 12
Hi,

When to use wait(),notify(),notifyAll(),.. all of these similar methods?


pls give the response immediatly
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

These methods are used for thread synchronization in multithreaded programs.
http://www.iam.ubc.ca/guides/javatut99/essential/threads/waitAndNotify.html
[ May 18, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Anita Singh
Greenhorn

Joined: May 18, 2007
Posts: 17
The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other.
wait():-Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
notify():-Wakes up a single thread that is waiting on this object's monitor.
notifyAll():-Wakes up all threads that are waiting on this object's monitor.

Anita Singh


SCJP 5.0 100%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About Thread topics