| Author |
Difference between Thread-Safe and Synchronization
|
Deepak Kumar Jena
Ranch Hand
Joined: Sep 08, 2010
Posts: 64
|
|
What are the differences between Thread-safe and Synchronization? Thanks in advance.
|
dkj4jdk
|
 |
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: 1046
|
|
|
what you get when you study these
|
SCJP6.0,My blog Ranchers from Delhi
|
 |
Chris Hurst
Ranch Hand
Joined: Oct 26, 2003
Posts: 370
|
|
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 ;-) )
|
"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.
|
 |
 |
|
|
subject: Difference between Thread-Safe and Synchronization
|
|
|