Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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="8d29b2b8a4fbb5fa-7132aded-49dc4080-9a6496f3-989faf8bbd74141b7bb463fb"><ac:plain-text-body><![CDATA[

[[API 2006

AA. Bibliography#API References#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="6499a6bfdabbcc51-4eba20bb-4e1a46cb-bb38a371-39d8c465309b7255b984a1f4"><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="802e2b82b014323d-60243cbe-45414ff0-a558ad27-9795d4641a79f366e2c3b70e"><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="2fbfd3451d151fc6-c64429b7-47bc4e2d-8ba0b698-20af7a61000815473d669ed9"><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="040a32dd916d3a1c-a0b4dd12-4cf94d28-9e16b9d1-9e54bd51d3352ca12f9e2b2c"><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="30cfdf91c206f2a7-8251c527-491a487e-a0e4a7b3-78cb7aaa24a83aa072109a03"><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>

...