Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on Synchronization

 
Rajesh Hegde
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a thread enters an object's monitor, can some other thread access the Non-Synchronized method of the same object?
rajesh
 
Jerry Pulley
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajesh,
Yes. All of the code that's synchronized on one monitor object is protected from access by more than one thread at a time. Code that's not synchronized, or is sync'ed on another monitor object, may be accessed freely.
Jerry
 
Marcela Blei
Ranch Hand
Posts: 477
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajesh:
I agree with Jerry.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic