473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Three methods of OBJECT... wait ,notify,notifyAll

dmjpro
2,476 2GB
plese guys explain me these three key methods supported by Object class....

kind regards.
dmjpro.
May 22 '07 #1
3 2243
JosAH
11,448 Expert 8TB
plese guys explain me these three key methods supported by Object class....

kind regards.
dmjpro.
Those three methods are the cornerstones of multi threaded programming;
whenever you synchronize on an object (either explicitly or implicitly on this),
the thread obtains ownership on the lock for that object. When you wait, you
release the lock and simply wait. When another thread obtains ownership
on the lock of that object it can notify a waiting thread or it can notify all the
waiting threads. Those threads wake up, check whether or not they can
continue whatever they want to do, and either wait again or release their
ownership on the lock and wait again. The language keyword 'synchronized'
obtains ownership on the lock; leaving the synchronized block/method,
releases the ownership again.

kind regards,

Jos
May 22 '07 #2
dmjpro
2,476 2GB
actually i also knew that ... but i needed liitle more extra dtls infos what an expert can explain me..that means u r one them.
one more thing JOASH ....do u have any link which can elaborate me more????
i fu have....... plz send me that link.

thanx anyway.

kind regards.
dmjpro.
May 22 '07 #3
JosAH
11,448 Expert 8TB
actually i also knew that ... but i needed liitle more extra dtls infos what an expert can explain me..that means u r one them.
one more thing JOASH ....do u have any link which can elaborate me more????
i fu have....... plz send me that link.

thanx anyway.

kind regards.
dmjpro.
Read Sun's Tutorial and you'll know everything.

kind regards,

Jos
May 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: GIMME | last post by:
One of my coworkers insists that one should never use static methods because race conditions exist. Thinking along the lines that all variable assignments are assignments to static variables. ...
29
by: Paul L. Du Bois | last post by:
Has anyone written a Queue.Queue replacement that avoids busy-waiting? It doesn't matter if it uses os-specific APIs (eg WaitForMultipleObjects). I did some googling around and haven't found...
5
by: Sunny | last post by:
Hi, I have to implement client/server application. The client have to instaniate an remoting object via http and pass some auth info. If the auth is OK, the client should invoke a method (or...
1
by: theneoenderson | last post by:
could any one tell me that why the 3 overloaded form of wait method and notify, notifyAll are in object class insted of thread class?
5
by: cozsmin | last post by:
hello , as u know wait() and notify() will not thow an exception if the method that calls them has the lock , or esle i misundrestood java :P this is the code that throws (unwanted) ...
11
by: Terry | last post by:
Hello! I'm trying to implement a message queue among threads using Queue. The message queue has two operations: PutMsg(id, msg) # this is simple, just combine the id and msg as one and put it...
6
by: Curious | last post by:
I have an arraylist used in three separate methods. In method #1 (event method), some items are removed from the arraylist if certain conditions are met; In method #2 (event method),...
0
by: Edwin.Madari | last post by:
updated creature running in its own thread will get you started. try it foryourself, change sleep times per your need. import os, sys, threading, time class Creature: def __init__(self,...
2
by: greyradio | last post by:
I've recently have been given an assignment to do and it seems that notify() does notify() any of the waiting threads. The project entails 10 commuters and two different toll booths. The EZPass booth...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.