Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-26-2008, 12:05 AM
Member
 
Join Date: Sep 2008
Posts: 4
denis is on a distinguished road
about wait() and notifyALL
hi everyone i have a question about using wait and notifyALL()
i am very confused about these two which i have never been able to use.

as per the API
wait() = Causes current thread to wait until either another thread invokes the notify() method or the notifyAll().
does the above wait() means that the current thread will wait as the monitor has already been in use by another thread. and will continue until the thread using the monitor releases the lock through notifyALL().

notifyall() = is notify all the threads waiting on the monitor.

i would really appreciate if somebody could post a simple code on wait and notifyALL().

thanks in advance.
Denis

Last edited by denis : 09-26-2008 at 12:07 AM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-26-2008, 01:51 AM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
Norm is on a distinguished road
Quote:
post a simple code on wait and notifyALL().
I did that just recently. Do a search for wait or notify.

It's in this thread:
Once again: waiting in a thread loop.

Last edited by Norm : 09-26-2008 at 01:54 AM.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 09-26-2008, 11:58 AM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
lots of examples in the net available do a google search.
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Application should wait until a Dialog closes hannehomuth Advanced Java 2 07-24-2008 04:51 PM
What is the execution path of wait() and notify() ? AegisCruiser Threads and Synchronization 1 04-23-2008 08:16 PM
How to use sleep() to wait for a while Java Tip java.lang 0 04-09-2008 08:32 PM


All times are GMT +3. The time now is 08:35 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org