https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Java_memory_modelJava memory model - Revision history2025-05-25T13:02:59ZRevision history for this page on the wikiMediaWiki 1.45.0-wmf.2https://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1257336905&oldid=prevGhostInTheMachine: Reverting edit(s) by 103.20.125.4 (talk) to rev. 1247703872 by Kvng: Vandalism (RW 16.1)2024-11-14T11:48:48Z<p>Reverting edit(s) by <a href="/wiki/Special:Contributions/103.20.125.4" title="Special:Contributions/103.20.125.4">103.20.125.4</a> (<a href="/wiki/User_talk:103.20.125.4" title="User talk:103.20.125.4">talk</a>) to rev. 1247703872 by Kvng: <a href="/wiki/Wikipedia:VANDAL" class="mw-redirect" title="Wikipedia:VANDAL">Vandalism</a> <a href="/wiki/Wikipedia:RW" class="mw-redirect" title="Wikipedia:RW">(RW 16.1)</a></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:48, 14 November 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The original Java memory model developed in 1995, was widely perceived as broken,<ref>{{cite journal |last1=Pugh |<del style="font-weight: bold; text-decoration: none;">fjirst1</del>=William |title=The Java memory model is fatally flawed |journal=Concurrency: Practice and Experience |date=2000 |volume=12 |issue=6 |pages=445–455 |doi=10.1002/1096-9128(200005)12:6<445::AID-CPE484>3.0.CO;2-A |url=https://www.cs.tufts.edu/~nr/cs257/archive/bill-pugh/jmm2.pdf |access-date=15 July 2021}}</ref> preventing many runtime optimizations and not providing strong enough guarantees for code safety. It was updated through the [[Java Community Process]], as Java Specification Request 133 (JSR-133), which took effect back in 2004, for [[Java version history#Java SE 5|Tiger (Java 5.0)]].<ref>{{cite web</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The original Java memory model developed in 1995, was widely perceived as broken,<ref>{{cite journal |last1=Pugh |<ins style="font-weight: bold; text-decoration: none;">first1</ins>=William |title=The Java memory model is fatally flawed |journal=Concurrency: Practice and Experience |date=2000 |volume=12 |issue=6 |pages=445–455 |doi=10.1002/1096-9128(200005)12:6<445::AID-CPE484>3.0.CO;2-A |url=https://www.cs.tufts.edu/~nr/cs257/archive/bill-pugh/jmm2.pdf |access-date=15 July 2021}}</ref> preventing many runtime optimizations and not providing strong enough guarantees for code safety. It was updated through the [[Java Community Process]], as Java Specification Request 133 (JSR-133), which took effect back in 2004, for [[Java version history#Java SE 5|Tiger (Java 5.0)]].<ref>{{cite web</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| url=https://www.ibm.com/developerworks/library/j-jtp03304/j-jtp03304-pdf.pdf</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| url=https://www.ibm.com/developerworks/library/j-jtp03304/j-jtp03304-pdf.pdf</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| title=Fixing the Java Memory Model, Part 2</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| title=Fixing the Java Memory Model, Part 2</div></td>
</tr>
</table>GhostInTheMachinehttps://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1257322029&oldid=prev103.20.125.4 at 09:26, 14 November 20242024-11-14T09:26:12Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 09:26, 14 November 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The original Java memory model developed in 1995, was widely perceived as broken,<ref>{{cite journal |last1=Pugh |<del style="font-weight: bold; text-decoration: none;">first1</del>=William |title=The Java memory model is fatally flawed |journal=Concurrency: Practice and Experience |date=2000 |volume=12 |issue=6 |pages=445–455 |doi=10.1002/1096-9128(200005)12:6<445::AID-CPE484>3.0.CO;2-A |url=https://www.cs.tufts.edu/~nr/cs257/archive/bill-pugh/jmm2.pdf |access-date=15 July 2021}}</ref> preventing many runtime optimizations and not providing strong enough guarantees for code safety. It was updated through the [[Java Community Process]], as Java Specification Request 133 (JSR-133), which took effect back in 2004, for [[Java version history#Java SE 5|Tiger (Java 5.0)]].<ref>{{cite web</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The original Java memory model developed in 1995, was widely perceived as broken,<ref>{{cite journal |last1=Pugh |<ins style="font-weight: bold; text-decoration: none;">fjirst1</ins>=William |title=The Java memory model is fatally flawed |journal=Concurrency: Practice and Experience |date=2000 |volume=12 |issue=6 |pages=445–455 |doi=10.1002/1096-9128(200005)12:6<445::AID-CPE484>3.0.CO;2-A |url=https://www.cs.tufts.edu/~nr/cs257/archive/bill-pugh/jmm2.pdf |access-date=15 July 2021}}</ref> preventing many runtime optimizations and not providing strong enough guarantees for code safety. It was updated through the [[Java Community Process]], as Java Specification Request 133 (JSR-133), which took effect back in 2004, for [[Java version history#Java SE 5|Tiger (Java 5.0)]].<ref>{{cite web</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| url=https://www.ibm.com/developerworks/library/j-jtp03304/j-jtp03304-pdf.pdf</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| url=https://www.ibm.com/developerworks/library/j-jtp03304/j-jtp03304-pdf.pdf</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| title=Fixing the Java Memory Model, Part 2</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>| title=Fixing the Java Memory Model, Part 2</div></td>
</tr>
</table>103.20.125.4https://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1247703872&oldid=prevKvng: grammar2024-09-25T14:33:11Z<p>grammar</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:33, 25 September 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|<del style="font-weight: bold; text-decoration: none;">Interact</del> of threads in Java software}}</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|<ins style="font-weight: bold; text-decoration: none;">Interaction</ins> of threads in Java software}}</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>Kvnghttps://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1247090902&oldid=prevGhostInTheMachine: Fixed ref with reFill 22024-09-22T19:25:25Z<p>Fixed ref with reFill 2</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 19:25, 22 September 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 46:</td>
<td colspan="2" class="diff-lineno">Line 46:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For the execution of a single thread, the rules are simple. The [[Java Language Specification]] requires a [[Java virtual machine]] to observe ''within-thread as-if-serial'' semantics. The runtime (which, in this case, usually refers to the dynamic compiler, the processor and the memory subsystem) is free to introduce any useful execution optimizations as long as the result of the thread in isolation is guaranteed to be exactly the same as it would have been had all the statements been executed in the order the statements occurred in the program (also called program order).<ref>{{cite web|last1=Manson|first1=Jeremy|title=JSR-133 FAQ|url=http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#reordering}}</ref></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For the execution of a single thread, the rules are simple. The [[Java Language Specification]] requires a [[Java virtual machine]] to observe ''within-thread as-if-serial'' semantics. The runtime (which, in this case, usually refers to the dynamic compiler, the processor and the memory subsystem) is free to introduce any useful execution optimizations as long as the result of the thread in isolation is guaranteed to be exactly the same as it would have been had all the statements been executed in the order the statements occurred in the program (also called program order).<ref>{{cite web|last1=Manson|first1=Jeremy|title=JSR-133 FAQ|url=http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#reordering}}</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The major caveat of this is that ''as-if-serial'' semantics do not prevent different threads from having different views of the data. The memory model provides clear guidance about what values are allowed to be returned when the data is read. The basic rules imply that individual actions can be reordered, as long as the ''as-if-serial'' semantics of the thread are not violated, and actions that imply communication between threads, such as the acquisition or release of a [[lock (computer science)|lock]], ensure that actions that happen prior to them are seen by other threads that see their effects. For example, everything that happens before the release of a lock will be seen to be ordered before and visible to everything that happens after a subsequent acquisition of that same lock.<ref>{{<del style="font-weight: bold; text-decoration: none;">cite</del> web<del style="font-weight: bold; text-decoration: none;">|title=JLS Happens-before Order</del>|url=<del style="font-weight: bold; text-decoration: none;">http</del>://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html<del style="font-weight: bold; text-decoration: none;">#jls-</del>17.<del style="font-weight: bold; text-decoration: none;">4</del>.<del style="font-weight: bold; text-decoration: none;">5</del>}}</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The major caveat of this is that ''as-if-serial'' semantics do not prevent different threads from having different views of the data. The memory model provides clear guidance about what values are allowed to be returned when the data is read. The basic rules imply that individual actions can be reordered, as long as the ''as-if-serial'' semantics of the thread are not violated, and actions that imply communication between threads, such as the acquisition or release of a [[lock (computer science)|lock]], ensure that actions that happen prior to them are seen by other threads that see their effects. For example, everything that happens before the release of a lock will be seen to be ordered before and visible to everything that happens after a subsequent acquisition of that same lock.<ref>{{<ins style="font-weight: bold; text-decoration: none;">Cite</ins> web|url=<ins style="font-weight: bold; text-decoration: none;">https</ins>://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html<ins style="font-weight: bold; text-decoration: none;">|title=Chapter </ins>17.<ins style="font-weight: bold; text-decoration: none;"> Threads and Locks|website=docs</ins>.<ins style="font-weight: bold; text-decoration: none;">oracle.com</ins>}}</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Mathematically, there is a [[partial order]] called the [[happened-before|''happens-before'']] order over all actions performed by the program. The ''happens-before'' order subsumes the program order; if one action occurs before another in the program order, it will occur before the other in the ''happens-before'' order. In addition, releases and subsequent acquisitions of locks form edges in the happens-before graph. A read is allowed to return the value of a write if that write is the last write to that variable before the read along some path in the ''happens-before'' order, or if the write is not ordered with respect to that read in the ''happens-before'' order.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Mathematically, there is a [[partial order]] called the [[happened-before|''happens-before'']] order over all actions performed by the program. The ''happens-before'' order subsumes the program order; if one action occurs before another in the program order, it will occur before the other in the ''happens-before'' order. In addition, releases and subsequent acquisitions of locks form edges in the happens-before graph. A read is allowed to return the value of a write if that write is the last write to that variable before the read along some path in the ''happens-before'' order, or if the write is not ordered with respect to that read in the ''happens-before'' order.</div></td>
</tr>
</table>GhostInTheMachinehttps://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1247090584&oldid=prevGhostInTheMachine: CN2024-09-22T19:23:48Z<p>CN</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 19:23, 22 September 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 17:</td>
<td colspan="2" class="diff-lineno">Line 17:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Context==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Context==</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Unreferenced section|date=September 2024}}</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The [[Java (programming language)|Java programming language]] and platform provide [[Thread (computer science)|thread]] capabilities. Synchronization between threads is notoriously difficult for developers; this difficulty is compounded because Java applications can run on a wide range of [[Processor (computing)|processors]] and [[operating system]]s. To be able to draw conclusions about a program's behavior, Java's designers decided they had to clearly define possible behaviors of all Java programs.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The [[Java (programming language)|Java programming language]] and platform provide [[Thread (computer science)|thread]] capabilities. Synchronization between threads is notoriously difficult for developers; this difficulty is compounded because Java applications can run on a wide range of [[Processor (computing)|processors]] and [[operating system]]s. To be able to draw conclusions about a program's behavior, Java's designers decided they had to clearly define possible behaviors of all Java programs.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>GhostInTheMachinehttps://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1247090272&oldid=prevGhostInTheMachine: Changing short description from "how threads in the Java programming language interact through memory" to "Interact of threads in Java software"2024-09-22T19:22:26Z<p>Changing <a href="/wiki/Wikipedia:Short_description" title="Wikipedia:Short description">short description</a> from "how threads in the Java programming language interact through memory" to "Interact of threads in Java software"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 19:22, 22 September 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|<del style="font-weight: bold; text-decoration: none;">how</del> threads in<del style="font-weight: bold; text-decoration: none;"> the</del> Java <del style="font-weight: bold; text-decoration: none;">programming language interact through memory</del>}}</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|<ins style="font-weight: bold; text-decoration: none;">Interact of</ins> threads in Java <ins style="font-weight: bold; text-decoration: none;">software</ins>}}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>GhostInTheMachinehttps://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1247043602&oldid=prevKvng: Changing short description from "Java programming language specification" to "how threads in the Java programming language interact through memory"2024-09-22T14:55:58Z<p>Changing <a href="/wiki/Wikipedia:Short_description" title="Wikipedia:Short description">short description</a> from "Java programming language specification" to "how threads in the Java programming language interact through memory"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:55, 22 September 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|Java programming language <del style="font-weight: bold; text-decoration: none;">specification</del>}}</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|<ins style="font-weight: bold; text-decoration: none;">how threads in the </ins>Java programming language <ins style="font-weight: bold; text-decoration: none;">interact through memory</ins>}}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>Kvnghttps://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1242210369&oldid=prevRublov: Adding short description: "Java programming language specification"2024-08-25T15:52:57Z<p>Adding <a href="/wiki/Wikipedia:Short_description" title="Wikipedia:Short description">short description</a>: "Java programming language specification"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:52, 25 August 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Short description|Java programming language specification}}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''Java memory model''' describes how [[thread (computer science)|threads]] in the [[Java (programming language)|Java programming language]] interact through memory. Together with the description of single-threaded execution of code, the memory model provides the [[formal semantics of programming languages|semantics]] of the Java programming language. </div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>Rublovhttps://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1235684325&oldid=prevKvng: better disambig2024-07-20T16:48:30Z<p>better disambig</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:48, 20 July 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 17:</td>
<td colspan="2" class="diff-lineno">Line 17:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Context==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Context==</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The [[Java (programming language)|Java programming language]] and platform provide [[Thread (computer science)|thread]] capabilities. Synchronization between threads is notoriously difficult for developers; this difficulty is compounded because Java applications can run on a wide range of [[<del style="font-weight: bold; text-decoration: none;">central</del> <del style="font-weight: bold; text-decoration: none;">processor</del>]]<del style="font-weight: bold; text-decoration: none;">s</del> and [[operating system]]s. To be able to draw conclusions about a program's behavior, Java's designers decided they had to clearly define possible behaviors of all Java programs.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The [[Java (programming language)|Java programming language]] and platform provide [[Thread (computer science)|thread]] capabilities. Synchronization between threads is notoriously difficult for developers; this difficulty is compounded because Java applications can run on a wide range of [[<ins style="font-weight: bold; text-decoration: none;">Processor</ins> <ins style="font-weight: bold; text-decoration: none;">(computing)|processors</ins>]] and [[operating system]]s. To be able to draw conclusions about a program's behavior, Java's designers decided they had to clearly define possible behaviors of all Java programs.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>On modern platforms, code is frequently not executed in the order it was written. It is reordered by the compiler, the processor and the memory subsystem to achieve maximum performance. On [[multiprocessor]] architectures, individual processors may have their own local caches that are out of sync with main memory. It is generally undesirable to require threads to remain perfectly in sync with one another because this would be too costly from a performance point of view. This means that at any given time, different threads may see different values for the same shared data.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>On modern platforms, code is frequently not executed in the order it was written. It is reordered by the compiler, the processor and the memory subsystem to achieve maximum performance. On [[multiprocessor]] architectures, individual processors may have their own local caches that are out of sync with main memory. It is generally undesirable to require threads to remain perfectly in sync with one another because this would be too costly from a performance point of view. This means that at any given time, different threads may see different values for the same shared data.</div></td>
</tr>
</table>Kvnghttps://en.wikipedia.org/w/index.php?title=Java_memory_model&diff=1235682989&oldid=prevKvng: disambig2024-07-20T16:36:47Z<p>disambig</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:36, 20 July 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 17:</td>
<td colspan="2" class="diff-lineno">Line 17:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Context==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Context==</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The [[Java (programming language)|Java programming language]] and platform provide [[Thread (computer science)|thread]] capabilities. Synchronization between threads is notoriously difficult for developers; this difficulty is compounded because Java applications can run on a wide range of [[<del style="font-weight: bold; text-decoration: none;">processors</del>]] and [[operating <del style="font-weight: bold; text-decoration: none;">systems</del>]]. To be able to draw conclusions about a program's behavior, Java's designers decided they had to clearly define possible behaviors of all Java programs.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The [[Java (programming language)|Java programming language]] and platform provide [[Thread (computer science)|thread]] capabilities. Synchronization between threads is notoriously difficult for developers; this difficulty is compounded because Java applications can run on a wide range of [[<ins style="font-weight: bold; text-decoration: none;">central processor</ins>]]<ins style="font-weight: bold; text-decoration: none;">s</ins> and [[operating <ins style="font-weight: bold; text-decoration: none;">system</ins>]]<ins style="font-weight: bold; text-decoration: none;">s</ins>. To be able to draw conclusions about a program's behavior, Java's designers decided they had to clearly define possible behaviors of all Java programs.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>On modern platforms, code is frequently not executed in the order it was written. It is reordered by the compiler, the processor and the memory subsystem to achieve maximum performance. On [[multiprocessor]] architectures, individual processors may have their own local caches that are out of sync with main memory. It is generally undesirable to require threads to remain perfectly in sync with one another because this would be too costly from a performance point of view. This means that at any given time, different threads may see different values for the same shared data.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>On modern platforms, code is frequently not executed in the order it was written. It is reordered by the compiler, the processor and the memory subsystem to achieve maximum performance. On [[multiprocessor]] architectures, individual processors may have their own local caches that are out of sync with main memory. It is generally undesirable to require threads to remain perfectly in sync with one another because this would be too costly from a performance point of view. This means that at any given time, different threads may see different values for the same shared data.</div></td>
</tr>
</table>Kvng