C Sharp Programming/Keywords/volatile
From Wikibooks, the open-content textbooks collection
The volatile keyword is used to declare a variable which 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 whenver the value is read, you are always getting the most recent (up-to-date) value of the variable.
class MyClass { public volatile long systemclock; }
| C# Keywords | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Special C# Identifiers | ||||||||||
|
This keyword has been part of the C# programming language since .NET Framework 1.1 (Visual Studio 2003).