• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

threads and synchronization

 
friso dejonge
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,
just trying to clear thngs up. To see if my code is ready for submitting...
In some of the postings i find that some people are talking about threading and synchronization (of the server) Can someone elaborate on what they have done on that. The whole data class is synchronized, so what else have they done on the server to make it threadsafe ?
thanks,
friso
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That really depends on your design. If you used a LockManager then certainly lock and unlock should be synchronized or the collection that holds the locked records. You, the developer, have to look at every method in every class and determine first, if more than a single thread may be calling that method and second, if there is the possibility of the object's state changing as a result of that call. If you answer yes to both questions, then the method should be synchronized (or the object whose state will change).
Hope this helps,
Michael Morris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic