If you don't know what Volatile is:
Quote:
Volatile keyword is used to define a variable which is to be modified across multiple threads without invoking lock statements(Although we do lock them most of the times). Volatile variables are not subject to compiler optimization and thus we will get the most updated value of the variable all the time. See the example below :