• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making a class synchronized

 
ragi singh
Ranch Hand
Posts: 198
Oracle Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all ,

can anyone elaborate as to how we can make a class synchronized.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ragi singh wrote:hi all ,

can anyone elaborate as to how we can make a class synchronized.


Why would you want to synchronize a class? Are you talking about synchronizing the access to the class data/fields. There are lot of similar posts in this forum- Threads and Synchronization. And its the forum for all the Threads and Synchronization related queries.
 
Nuwan Arambage
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
right , there are several post out there to learn synchronization in java....
For you knowledge, as programmers we never think of synchronizing a whole class.

It is important to note that best practice is to synchronize the code of block you required since synchronization is a performance hit

Hope you understand.

regards ,
Nuwan Armabage
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic