If I have something like this...
volatile long something_global = 0;
long some_public_func()
{
return something_global++;
}
Would it b
No - volatile does not mean synchronized. It just means that every access will return the most up-to-date value (as opposed to a copy cached locally in the thread).
Post-increment is not an atomic operation, it is a memory access followed by a memory write. Interleaving two can mean that the value is actually incremented just once.