File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes Difference between Thread-Safe and Synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Difference between Thread-Safe and Synchronization" Watch "Difference between Thread-Safe and Synchronization" New topic

Difference between Thread-Safe and Synchronization

Deepak Kumar Jena
Ranch Hand

Joined: Sep 08, 2010
Posts: 68

What are the differences between Thread-safe and Synchronization? Thanks in advance.

Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

How do you want to compare? Thread-Safe is a feature but, Synchronization is a method/procedure to do it.

|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

what you get when you study these

SCJP6.0,My blog Ranchers from Delhi
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 443

Thread safe definition here

Synchronisation is a language feature you might use to achieve thread safety (if you use it right ;-) )

"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

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.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
I agree. Here's the link:
subject: Difference between Thread-Safe and Synchronization
It's not a secret anymore!