This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Making a class synchronized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Making a class synchronized" Watch "Making a class synchronized" New topic
Author

Making a class synchronized

ragi singh
Ranch Hand

Joined: Mar 10, 2010
Posts: 198

hi all ,

can anyone elaborate as to how we can make a class synchronized.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

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.


Mohamed Sanaulla | My Blog
Nuwan Arambage
Ranch Hand

Joined: May 05, 2010
Posts: 76
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


Thinker
Nuwan Arambage
 
jQuery in Action, 2nd edition
 
subject: Making a class synchronized