411 REFERENCE · Wikibooks
C Sharp Programming/Keywords/volatile
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Keywords volatile
__TOC__
The volatile keyword is used to declare a variable that may change its value over time due to modification by an outside process, the system hardware, or another concurrently running thread.
You should use this modifier in your member variable declaration to ensure that whenever the value is read, you are always getting the most recent (up-to-date) value of the variable.
class MyClass
{
public volatile long systemclock;
}
This keyword has been part of the C# programming language since .NET Framework 1.1 (Visual Studio 2003).