Java Thread
What is the meaning of thread safety ?
I consider that most of people don’t understand it or describe it clearly. Thread safety should be called as Memory safety. You should ensure data right and uniformity when many threads visit it concurrently.
How to avoid thread safety problem ?
There are three methods to solve it .
don’t shared a status variable at threads
make a status variable Immutable
use synchronization when thread visit a status variable