...
| 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="62ff72ccda8463b7-329f6085-4f9b41f9-a532858f-c063fa591cd3378510f4c5d1"><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="3594b612d3ce501a-ee954582-402a485e-b0a7af35-cf460c6b24fce9a36a6bbbad"><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="f05732b178cafe98-1e0e640c-457c46a8-ba048d1f-c06bacea234f2b600804c97f"><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="3162c4584c4c6bda-f1d837ad-4c614d18-b3bc9090-141d090cd604457f6d2016c5"><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="e6920a0347d2e037-a94baec7-48b24c53-9f39bad6-c47bcf04488d85fe0a327297"><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="99e0f2d12ce1b7c0-36f48b92-49b24eb8-920f9e81-790ed0db8805e4ccac2b48d0"><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> |
...