...
Wiki Markup |
---|
This approach must not be used for getter methods that perform any additional operations other than returning the value of a volatile field without use of synchronization. Unless read performance is critical, this technique may lack significant advantages over synchronization \[[Goetz 2006|AA. Bibliography#Goetz 06]\]. |
Rule VNA06-J. Do not assume that declaring a reference volatile guarantees visibility of the members of the referenced object also addresses the volatile-read, synchronized-write pattern.
Compliant Solution (Read-Write Lock)
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5a8b35081fcd24bf-3aec8387-4d0e4a88-86c28f53-1d879c94735d581d41f2c691"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] | Class AtomicInteger | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="28a2f27a25b94a6f-692d3668-47a54f8e-bd7da02e-12412be6a122cd53457392d9"><ac:plain-text-body><![CDATA[ | [[Bloch 2008 | AA. Bibliography#Bloch 08]] | Item 66: Synchronize access to shared mutable data | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6073a68b818bbd3d-d4fdb0f5-4bd64a6a-b934a22c-7a8bcf9cfdec24475e718bad"><ac:plain-text-body><![CDATA[ | [[Goetz 2006 | AA. Bibliography#Goetz 06]] | 2.3. "Locking" | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2cd54d428f592a2b-afa5721a-4ea748a2-9c838eb4-f875368831e3bbb4ef1cbd88"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS 05]] | [Chapter 17 Threads and Locks | http://java.sun.com/docs/books/jls/third_edition/html/memory.html], ]]></ac:plain-text-body></ac:structured-macro> | |
| Section 17.4.5 Happens-Before Order | ||||
| Section 17.4.3 Programs and Program Order | ||||
| Section 17.4.8 Executions and Causality Requirements | ||||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f39a27b95dad4329-68d41a80-4bbc446e-9824bbc5-af4b14266f216b8fc476de05"><ac:plain-text-body><![CDATA[ | [[Lea 2000 | AA. Bibliography#Lea 00]] | Section 2.2.7 The Java Memory Model | ]]></ac:plain-text-body></ac:structured-macro> | |
| Section 2.1.1.1 Objects and Locks | ||||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5b0448cf2d6bb2bf-14430c79-4a364368-824ab0de-825d26dc25546e2d2fcc5ce5"><ac:plain-text-body><![CDATA[ | [[Tutorials 2008 | AA. Bibliography#Tutorials 08]] | [Java Concurrency Tutorial | http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] | ]]></ac:plain-text-body></ac:structured-macro> |
...