• 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

sychronized method

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose when a thread is executing the synchroized method of a some shared resource,at that time the resource was locked by some other thread.

question:
what is the status of the thread, trying to get a resource?.whether it is continuously excute the synchroized method and without executing it,it may go the next statement or is the thread suspend.
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The thread is "blocked waiting for monitor". In this state, it uses hardly any CPU, until it is able to get the lock on the monitor and continue execution.
 
kumarth ravi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I understand the block waiting is a suspend state.during the block waiting where will be the thread.(in case of calling wait() , then the thread will be in the waiting queue).
 
reply
    Bookmark Topic Watch Topic
  • New Topic