Wiki Markup |
---|
Compound operations are operations that consist of more than one discrete operation. Expressions that include postfix or prefix increment ({{\+\+}}), postfix or prefix decrement ({{\-\-}}), or compound assignment operators always result in compound operations. Compound assignment expressions use operators such as {{\*=, /=, %=, \+=, \-=, <<=, >>=, >>>=, \^=}} and {{\|=}} \[[JLS 2005|AA. Bibliography#JLSReferences#JLS 05]\]. Compound operations on shared variables must be performed atomically to prevent [data races|BB. Glossary#data race] and [race conditions|BB. Glossary#race conditions]. |
...
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#GoetzReferences#Goetz 06]\]. |
Compliant Solution (Read-Write Lock)
...
Wiki Markup |
---|
Read-write locks allow shared state to be accessed by multiple readers or a single writer but never both. According to Goetz \[[Goetz 2006|AA. Bibliography#GoetzReferences#Goetz 06]\] |
In practice, read-write locks can improve performance for frequently accessed read-mostly data structures on multiprocessor systems; under other conditions they perform slightly worse than exclusive locks due to their greater complexity.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e622ba0af1340998-c59ee1bc-42f44955-aa79b135-9a5f4409d7f0ec344cd0ab28"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API References#API 06]] | Class | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7cc0160e7db7ede0-39d0613b-41904018-bce090b8-d732f7ddae667b98ccff4800"><ac:plain-text-body><![CDATA[ | [[Bloch 2008 | AA. Bibliography#Bloch References#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="2ede92b2487f7195-c17cb395-402f41dd-b246ad5e-4d8a6e36b57d16a229af7d58"><ac:plain-text-body><![CDATA[ | [[Goetz 2006 | AA. Bibliography#Goetz References#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="631cf99bed1927b2-ff4198e2-4299403f-8c27a27e-16b54e881937ad041231844d"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS References#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> | |
| §17.4.5, Happens-Before Order | ||||
| §17.4.3, Programs and Program Order | ||||
| §17.4.8, Executions and Causality Requirements | ||||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="48ee6478680aa66f-6842d444-49c44970-949c974c-111b40e3e3689c39596ac570"><ac:plain-text-body><![CDATA[ | [[Lea 2000 | AA. Bibliography#Lea References#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="4a82b99eb0bd02bb-60cf57c3-442d44d6-9886bbf1-8c73c04da8c1c55c8b4805a8"><ac:plain-text-body><![CDATA[ | [[Tutorials 2008 | AA. Bibliography#Tutorials References#Tutorials 08]] | [Java Concurrency Tutorial | http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] | ]]></ac:plain-text-body></ac:structured-macro> |
...