Versions Compared

Key

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

...

Wiki Markup
The documentation of a class that supports client-side locking should explicitly state its applicability. For example, the class {{java.util.concurrent.ConcurrentHashMap<K,V>}} should not be used for client-side locking because its documentation \[[API 2006|AA. Bibliography#API 06]\] states that:

However, even though all operations are thread-safe, retrieval operations do not entail locking, and there is not any support for locking the entire table in a way that prevents all access. This class is fully interoperable with Hashtable in programs that rely on its thread safety but not on its synchronization details.

...

If the Book class were to change its synchronization policy in the future, the BookWrapper class's locking strategy might silently break. For instance, the BookWrapper class's locking strategy would break if Book were modified to use a private final lock object, as recommended by rule LCK00-J. Use private final lock objects to synchronize classes that may interact with untrusted code. The BookWrapper class's locking strategy would break This is because threads that call BookWrapper.getDueDate() would perform operations on the thread-safe Book using its new locking policy. However, threads that call the renew() method would always synchronize on the intrinsic lock of the Book instance. Consequently, the implementation would use two different locks.

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="896b4dc0ac16abfd-83445e96-461b4450-8f38b8da-c9a5e86cecafd147714a2ef2"><ac:plain-text-body><![CDATA[

[[API 2006

AA. Bibliography#API 06]]

Class Vector, Class WeakReference, Class ConcurrentHashMap<K,V>

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="a7a832f8a46c64a0-3120142e-469a4d85-ba22a7f6-ad60a03369f113c7e31ec688"><ac:plain-text-body><![CDATA[

[[JavaThreads 2004

AA. Bibliography#JavaThreads 04]]

8.2, Synchronization and Collection Classes

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7577b36f656e5033-135681d2-483a4ee3-89f88f2d-eb7363584034291d95245c13"><ac:plain-text-body><![CDATA[

[[Goetz 2006

AA. Bibliography#Goetz 06]]

4.4.1, Client-side Locking; 4.4.2, Composition; and 5.2.1, ConcurrentHashMap

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2f57f72c87a6b941-d0f5491e-4c1844aa-b9788562-c96dcaf91f12b6d17dbd22ba"><ac:plain-text-body><![CDATA[

[[Lee 2009

AA. Bibliography#Lee 09]]

Map & Compound Operation

]]></ac:plain-text-body></ac:structured-macro>

...