Question: if a long variable is declared as :-

**private volatile long counter = 0;**

now if i increment it using pre-increment operator, then would the operation be atomic ?

if yes, then will it be more efficient than `java.util.concurrent.atomic.AtomicLong` object's increment ??

Answer: 
`volatile` keyword only solves [visibility](http://www.ibm.com/developerworks/library/j-jtp03304/) problem. You have to use `AtomicLong` or `synchronized` method/block for atomicity ([Atomicity in concurrent programming](http://en.wikipedia.org/wiki/Atomicity_%28programming%29)).

One more article that came out today: [Demonstrating when volatile is required](http://java.dzone.com/articles/demonstrating-when-volatile)
A volatile variable is not the same as an atomic variable.

For volatile variables, the java compiler will attempt to minimize shuffling commands around for the sake of efficiency (don't ask me the details of that.. ), to avoid concurrency problems.

Atomic variables are explicitly made for atomic operations, like in your case incrementing a variable atomically.