File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Help me  on Threads!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Help me  on Threads!!! " Watch "Help me  on Threads!!! " New topic

Help me on Threads!!!

SaiRam NageshKumar

Joined: Apr 06, 2000
Posts: 21
Dear all,
How the threads are handled with monitor?
Awaiting the responses!
Sai ram
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
Could you be more vague?

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
SaiRam NageshKumar

Joined: Apr 06, 2000
Posts: 21
Dear Tony,
I would like to know that, how the threads(processes) are able to communicate ultimately with the threads and whether th monitor will also be acting as an object and etc.,
Respond soon!
Sai Ram
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
your question is a little ambigous. But I think I can help.
Have you ever been to a laundry mat? Think of the washers and dryers as objects and the people as threads. When a washer (object)is in use by a person (a thread) no one else may use that washer (object). When a thread has a lock on a object no other threads may access the synchronized code of that object. All other threads that wish to access the synchronized code are put in a waiting mode (just like when you have to wait on a dryer to open up). when the thread is finished it releases its lock on the object and then may call the object's notify()/notifyAll() meathod and tell the waiting threads that the object is ready. At that point another thread will obtain the lock on the object. hope this helps.
P.S. to all other readers if I am wrong please correct me.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Interesting Example Airman. I liked it.
maha anna
I agree. Here's the link:
subject: Help me on Threads!!!
It's not a secret anymore!