• Post Reply Bookmark Topic Watch Topic
  • New Topic

thread safe  RSS feed

 
sandeep Talari
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can somebody clarify me , threadsaftey means class is non-synchronized or synchronized. give details please

if methods of a class are non-synchronized means the class is theardsafe?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sandeep Talari:
can somebody clarify me , threadsaftey means class is non-synchronized or synchronized. give details please

if methods of a class are non-synchronized means the class is theardsafe?


Thread safety means that multiple threads can use the class and/or service simultaneously, and it works correctly as designed. This can be done with synchronization, or without synchronization. Synchronization is merely a tool -- you still have to code it correctly to make it thread safe.

Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!