After Googling a lot, I found multiple definitions for volatile keyword.
Concept 1:
Some Website says, it is thread safe, as thread acts on the main memory where volatile keyword is stored and modifies it without pulling it to thread stack space.
Concept 2:
Some says, it is not thread safe, as it causes Thread race condition. As , thread pulls volatile variable to stack space , modifies it and immediately puts it back to main memory. But, in between another thread can come and act upon the volatile variable and takes action. So, this way, some value gets missing.
Which concept is correct?