Content deleted Content added
NeonMerlin (talk | contribs) m →In C# |
→In Java: clarified the global ordering over volatiles |
||
Line 207:
==In Java==
The [[Java programming language]] also has the <code>volatile</code> keyword, but it is used for a somewhat different purpose. When applied to a field, the Java qualifier <code>volatile</code> provides the following guarantees:
*In all versions of Java, there is a global ordering on
*In Java 5 or later, volatile reads and writes establish a [[happened-before|happens-before relationship]], much like acquiring and releasing a mutex.<ref>Section 17.4.4: Synchronization Order
{{cite web
|