• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help me on Threads!!!

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
How the threads are handled with monitor?
Awaiting the responses!
Sai ram
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you be more vague?
 
SaiRam NageshKumar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
Thanks!
Sai Ram
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
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.
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting Example Airman. I liked it.
regds
maha anna
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic