Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Making a class synchronized  RSS feed

 
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.
 
Bartender
Posts: 3185
34
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.
 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!