• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Question About Read Locking

 
Yanxin Zhao
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone:
I got a problem when I check my code. My read, update, find and others methods are all synchonized. but I am afraid of that my read mechanism will became a problem. does somebody can tell me something about lock mechanism and something I should pay attention to in read locking ?
 
Inuka Vincit
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you mean syncronized I hope you dont mean using the the syncronized keyword for the whole method. If that is the case what would be the point of locks. Depending on your implementation you should not have a need for locks for the read method, however if you are not using a cache you will have to use an object lock when accessing the file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic