Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between Thread-Safe and Synchronization

 
Deepak Kumar Jena
Ranch Hand
Posts: 68
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the differences between Thread-safe and Synchronization? Thanks in advance.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you want to compare? Thread-Safe is a feature but, Synchronization is a method/procedure to do it.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what you get when you study these
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thread safe definition here http://en.wikipedia.org/wiki/Thread_Safe.

Synchronisation is a language feature you might use to achieve thread safety (if you use it right ;-) )
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another way of providing thread safety instead of synchronization can be accomplished by using classes from the java.util.concurrent.locks package.
It is similar to synchronization (lock on an Objects monitor) but using locks the locks can be released in a different order then obtaining them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic