• Post Reply Bookmark Topic Watch Topic
  • New Topic

calling synchronized methods of the object simultaneouly.  RSS feed

 
prasanth chiru
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my object I am having many synchronized methods. If a thread is calling one synchronized method, can any other thread call some other synchronized method of the same object at the same time.
If anybody knows about it, please help me.
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NO a thread cannot call any of the synchronized blocks of an Object once it is locked by another thread either through a synchrnoized block or a synchronized method. It can however call any of the methods that are not synchronized.
 
prasanth chiru
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi rahul,
Thankyou much for neat explaination.
 
prasanth chiru
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi rahul,
Thankyou very much for the clear explaination.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!